So, I have a wave skip script in a tower defense game, but it has a problem, when it the wave ends too early, that is, before 10 seconds has passed (how long it takes for the gui to pop up), it runs while true do
again, while the other is still running. How would I stop this from happening?
BTW: I have a main script which sets the TimeSinceWaveStarted
value to -1000, to make sure the wave skip doesnt pop up when the intermission is on.
info.CurrentWave:GetPropertyChangedSignal("Value"):Connect(function()
info.TimeSinceWaveStarted.Value = 0
while true do
wait(1)
info.TimeSinceWaveStarted.Value += 1
if info.CurrentWave.Value == 15 then
break
end
if info.TimeSinceWaveStarted.Value >= 10 then
event:FireAllClients()
break
end
end
end)