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)

3 comments
If it was admin commands it would stop the script being used further. Wouldn't it?
Should I use child:remove() instead?
In some cases, removing or destroying the script object will stop it, but not all.