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

Why Is My Script Not Working?

I'm scripting for someone and they want me to make a server control in game script that disables all scripts other than this one. It will have more commands. This is just the main bit, however it doesn't work. I'm not very good at scripting but don't want to displease someone I'm scripting for.

game.Players.LocalPlayer.Chatted:connect(function()
if c:lower():sub(1,5) == "/ctrl" then
child = game:GetChildren()
if child.ClassName == "Script" or child.ClassName == "LocalScript" or child.ClassName == "ModuleScript" then
child.Disabled = true
end
end
end)

1 answer

✓ Accepted answer

Setting Disabled to true after a Script has started running doesn't do anything.

There is no guaranteed way to stop scripts unless you can guarantee their source acts in particular ways ahead of time.

3 comments

0

If it was admin commands it would stop the script being used further. Wouldn't it?

0

Should I use child:remove() instead?

0

In some cases, removing or destroying the script object will stop it, but not all.

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