Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do I stop a script entirely?

I have tried doing this like:

if string.sub(msg,1,8) == "stopscr/" then
error("Done")
end

But it's just not working! Anyone know why?

3 answers

Just disable the script when you need to by using the 'Enabled' value in the properties of the script (if you click it in the Explorer).

2 comments

0

He wants a command type script.

0

^ I don

if string.sub(msg,1,8) == "stopscr/" then script.Disabled = true end

Also this will permanently stop the script. Unless you enable it with

[Name of script].Disabled = false

In another script

Disable should stop the script.

1 comment

0

I want a script that isn't script.Disabled because that gives me a mess of scripts

You could use this to stop the script in commands

local function die()
	Players.die -- Not a real thing lol
end
return
die() -- Would not run as there is a return function above

2 comments

0

return on outside of function?

0

wherever you want the script to stop

This discussion is preserved as it was. New answers, comments, and votes are closed.