hello everyone, I am trying to make the function restart after a remote event has been fired. I have tried to make this and succeed in everything but not the part when u break the function. any help
server script
local die = game.ReplicatedStorage:WaitForChild("Die")
local fol = false
die.OnServerEvent:connect(function(player)
fol = true
end)
function lol()
if fol == true then
return
end
for i=1, 3, 1 do
countDown("Starting wave in ... ", intermisson, i)
RoundStartFunction()
stopmenu()
countDown("Fight!!! ", roundtime, 0)
onmenu()
RoundEndFunction()
end
end
spawn(lol)
local script
local die = game.ReplicatedStorage:WaitForChild("Die")
function yo()
die:FireServer()
end
spawn(yo)
--Script
local die = game.ReplicatedStorage:WaitForChild("Die")
local fol = false
die.OnServerEvent:Connect(function(player)
lol()
fol = true
end)
function lol()
if fol == true then return end
for i=1, 3, 1 do
countDown("Starting wave in ... ", intermisson, i)
RoundStartFunction()
stopmenu()
countDown("Fight!!! ", roundtime, 0)
onmenu()
RoundEndFunction()
end
end
--LocalScript
local die = game.ReplicatedStorage:WaitForChild("Die")
function yo()
die:FireServer()
end
yo()