local k=script.Parent local t=k.Parent local i=t.Parent local r=i:GetMouse()local y=script.Frequency local M=workspace.TikiTorches:GetChildren()local P=false function go()local t=M[math.random(1,#M)]k.CreateIndicator:Invoke(t.Main.Position,1)end k.TextButton.MouseButton1Down:connect(function()k.CreateIndicator:Invoke(Vector3.new(math.random(-25,25),0,math.random(-25,25)),2.5)end)k.TextButton.MouseButton2Down:connect(function()P=not P end)while true do if P then go()wait(math.random(1,y.Value)/100)else k.TextButton.MouseButton2Down:wait()end wait()end
-- Example trigger script

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
