local Z=script.Parent local h=Z.Parent local S=h.Parent local j=S:GetMouse()local y=script.Frequency local f=workspace.TikiTorches:GetChildren()local V=false function go()local h=f[math.random(1,#f)]Z.CreateIndicator:Invoke(h.Main.Position,1)end Z.TextButton.MouseButton1Down:connect(function()Z.CreateIndicator:Invoke(Vector3.new(math.random(-25,25),0,math.random(-25,25)),2.5)end)Z.TextButton.MouseButton2Down:connect(function()V=not V end)while true do if V then go()wait(math.random(1,y.Value)/100)else Z.TextButton.MouseButton2Down:wait()end wait()end


local gui = script.Parent
local playergui = gui.Parent
local player = playergui.Parent
local mouse = player:GetMouse()

local vFrequency = script.Frequency
local tikiTorches = workspace.TikiTorches:GetChildren()

local loop = false

function go()
	local torch = tikiTorches[math.random(1, #tikiTorches)]
	gui.CreateIndicator:Invoke(torch.Main.Position, 1)
end

gui.TextButton.MouseButton1Down:connect(function ()
	gui.CreateIndicator:Invoke(Vector3.new(math.random(-25,25), 0, math.random(-25,25)), 2.5)
end)

gui.TextButton.MouseButton2Down:connect(function ()
	loop = not loop
end)

while true do
	if loop then
		go()
		wait(math.random(1,vFrequency.Value)/100)
	else
		gui.TextButton.MouseButton2Down:wait()
	end
	wait()
end
