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
You could remove the wait, or you could use the 'Spawn' function (or a coroutine). In your case, I'd suggest using 'Spawn'.
http://wiki.roblox.com/index.php?title=Function_Dump/Roblox_Specific_Functions#Spawn