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)
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.