What would be the best way to restart a script so it starts from the begging? Right now i am just making the script disabled then making it not disabled after i do stuff but it is not working the best.
If you want to restart a script from the beginning, use return
.
Here's an example of return:
local player = "ApinityYT" script.Parent.MouseButton1Click:connect(function() if game.Players.LocalPlayer.Name == player then print("Player found!") else return -- This returns to the MouseClick function and waits until it gets clicked again end end)
I am not sure if this is correct, if someone would like to correct me, they can do so, i won't be offended because i barely know how to script. (lol..)