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 11 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:

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

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

1 answer

Log in to vote
0
Answered by 11 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:

1script.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 — 11y
Ad

Answer this question