Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to stop a script?

Asked by 10 years ago

Ok, so let's say I want to stop a script when something certain happens. You can't just use end or it will not even bother running the script.

Example:

game.Players.jaytheidiot.Chatted:connect(function(Msg)
if Msg == "lol" then
Workspace.jaytheidiot.Torso:Destroy()
elseif Msg == "Hi" then
--Stop the script from running here
end
end)

How would I get the script to stop in that location?

1 answer

Log in to vote
0
Answered by 10 years ago

probobly just put return, im not sure if that will work. If you want that the dude say hi, then the script gets disabled(witch means that the script wont work anymore, even if he says lol, nothing will happen), then put:

script.Disabled = true
0
The script in question is running on a script builder. Not on an actual place. I have tested and using that in place will not work. jaytheidiot 60 — 10y
Ad

Answer this question