Hello! I tried making a self destruct script and put wait(512), and I tested then waited 512 seconds and nothing happened. I tried going to google, developer hub, and there was nothing. So I changed 512 to 10 seconds then tested and it worked. Is there a limit on how many seconds you can put with wait()?
here is what the code looked like:
local alert = game.ServerStorage.emergency:Clone()
local siren = game.ServerStorage.siren:Clone()
siren.Parent = workspace
siren.Playing = true
alert.Parent = workspace
alert.Looped = true
wait(24)
alert.Playing = true
wait(526)
local D = game.ServerStorage.DV:Clone()
local air = game.ServerStorage.air:Clone()
D.Parent = workspace
air.Parent = workspace
D.Playing = true
air.Playing = true
this is the solution I tried:
The reason I’m trying to do this is because I am trying to make a ESDS (emergency self destruct sequence) where there is a 5 minute warning countdown before detonation.
sorry if this is idiotic, I’m a bit new to LuaU scripting
Generally wait is not a good option anymore. The new task library has a replacement, you should instead use task.wait(), it has the same parameters as wait() but it is more reliable.
Like @RecanValor mentioned you can also use task.delay to schedule it to run later.