I want to make a script go back to the beginning after it has run through all the functions and waited. I would assume you would use a while loop but I'm not sure how to make it go to the beginning if this script is true:
function waitforwinner() if #getTeam(Game.Teams.Survivors) == 0 then m = Instance.new("Message",Workspace) m.Text = "The final survivor has been infected. Infected win!" wait(3) m:Destroy() --Put reset part here end end
Thanks!
If I correctly understand what you're doing, it's pretty easy. Basically just call the function again from inside the function. So:
function waitforwinner() if #getTeam(Game.Teams.Survivors) == 0 then m = Instance.new("Message",Workspace) m.Text = "The final survivor has been infected. Infected win!" wait(3) m:Destroy() waitforwinner() end end
--MightyWanderer
easy, make a while loop.
for example,
a = 1 while a == 1 then function() wait() end