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

Why it will disable every local script inside of the tool how can I change it so it will work?

Asked by
royee354 129
6 years ago

Alright so, I have 15 local scripts in a tool one of them called banana others are in other names I want that when I say the name of the script - "Banana" It will disable all of the scripts in the tool beside the banana script, I have tried to do somthing like:

g = script.Parent:GetChildren() for i = 1, #g do if g[i].ClassName == "LocalScript" then if g[i].Name == "Banana" then return end g[i].Disabled = true end end

so, what it did is basically nothing, nothing was disabled. all I need is to know how to rewite this code so it would not disable banana with the other scripts, hope you can help me

royee354.

0
Scriptingblock please User#20388 0 — 6y
0
for index, Lscript in pairs(script.Parent:GetChildren()) do if Lscript:IsA('LocalScript') and Lscript.name ~= SearchFor then Lscript.Disabled = true end end User#20388 0 — 6y
0
SearchFor would be the name of your script User#20388 0 — 6y
0
Alright, let me try this. royee354 129 — 6y
0
You are amazing!!! it worked, thanks alot! royee354 129 — 6y

1 answer

Log in to vote
0
Answered by
royee354 129
6 years ago

[SOLVED]

Ad

Answer this question