Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why Is My Script Not Working?

Asked by 10 years ago

Please make your question title relevant to your question content. It should be a one-sentence summary in question form.

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

Log in to vote
0
Answered by
BlueTaslem 18071 Moderation Voter Administrator Community Moderator Super Administrator
10 years ago

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.

0
If it was admin commands it would stop the script being used further. Wouldn't it? General_Scripter 425 — 10y
0
Should I use child:remove() instead? General_Scripter 425 — 10y
0
In some cases, removing or destroying the script object will stop it, but not all. BlueTaslem 18071 — 10y
Ad

Answer this question