The reason why wait(math.huge)
can't be used in Roblox anymore, is because previously when players put wait(math.huge)
in a script, it would break all the wait
's in the game.
Math.huge is infinity, so if you want a script to stop running you should either disable or end the script there. You could also have an infinite loop and break when it is time to run the script again.
--Use an infinite loop to stop the script. Or Disable it. script.Disable = true --or while wait() do end
Hope it helps!
You can only wait for a max of 30 seconds when using OnClose
. So wait(math.huge)
won't work.