Hey guys I need ya'll help. So let's say I have a script like this running:
script.Parent.Event:connect(function()
print("Starting")
wait(350)
--Do more stuff.
end)
But when it is waiting, let's say people lost the game and I don't want the script to run anymore and I want it to stop and go all the way back to the beggining.
How do I do that?
I'm not sure if you use return but I don't know how to use return anyways..
Note:Making a game where you have to survive until rescue arrives but when the players LOSE the game the script still runs and the bus still is active. How do i stop that?
I really would apreciate who would help me with this

3 comments
you could could a global value somewhere like in lighting, and make the value be true/false after the round. Then add a loop function in that part of the script so it keeps checking if the value is true/false.
You should use ReplicatedStorage or ServerStorage instead of Lighting for storing things.
Good idea. Thanks