Okay, the title has nothing to do with the thing I want to fix.
What I want to do is to carry the script on without stopping it at my function add60() Since it is a loop. It won't carry on until it finishes, is there a way to bypass this?
Script:
Temperature=game.Workspace.TemperatureValue
ReactorSafeguards=game.Workspace.ReactorSafeguards
ReactorMeltdownSong=game.Workspace.ReactorMeltdownSong
EmergencyPower=game.Workspace.EmergencyPower
EL1=game.Workspace.ELS.EL1.Toggle
EL2=game.Workspace.ELS.EL2.Toggle
function shake()
local camera = game.Workspace.CurrentCamera
for i = 1,10000 do
wait()
camera.CoordinateFrame = camera.CoordinateFrame * CFrame.new(0,2,0)
wait()
camera.CoordinateFrame = camera.CoordinateFrame * CFrame.new(0,-2,0)
end
end
function add60()
for i=1, 10 do -- THIS IS THE FUNCTION WHAT LOOPS
wait(2)
script.Parent.TemperatureValue.Value = script.Parent.TemperatureValue.Value +60
end
end
while true do
wait()
if Temperature.Value >= 2000 then
Temperature.Value = 2001
add60() -- IT STOPS HERE UNTIL IT HAS FINISHED.
ReactorSafeguards:Play()
wait(2)
ReactorMeltdownSong:Play()
wait(4)
ReactorSafeguards:Play()
shake()
wait(9)
EmergencyPower:Play()
wait(1)
EL1.Value = true
EL2.Value = true
break
end
end

3 comments
Thanks! :D
What would be the merit of
SpawnoverDelay?They do exactly the same thing essentially, with one difference; Delay executes the given function after a given amount of time has passed, whilst Spawn executes the given function as soon as the thread next yields. So the only merit I can see in this case is less typing, unless you want to add something.