Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

[Found the real answer myself] Why does wait(math.huge) not wait forever?

Asked by 9 years ago

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.

0
Why would you want to do that? You're basically disabling the script that way. funyun 958 — 9y
0
I know it's useless, but I just wanted to use it as a joke for things with wait limitations. Such as ===game.OnClose = function() wait(math.huge) end==== magiccube3 115 — 9y

1 answer

Log in to vote
1
Answered by 9 years ago

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.


Final Product

--Use an infinite loop to stop the script. Or Disable it.
script.Disable = true
--or
while wait() do end


Hope it helps!


Additional things

You can only wait for a max of 30 seconds when using OnClose. So wait(math.huge) won't work.

0
I don't think anyone understood my actual question but thanks for addressing it as you read it. I'm just commenting on your answer to point out that if onclose is set to wait for lets say 1000000 seconds, it will wait for 30 seconds and then close. magiccube3 115 — 9y
Ad

Answer this question