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

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

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.

5 comments

0

Scriptingblock please

0

for index, Lscript in pairs(script.Parent:GetChildren()) do if Lscript:IsA('LocalScript') and Lscript.name ~= SearchFor then Lscript.Disabled = true end end

0

SearchFor would be the name of your script

0

Alright, let me try this.

0

You are amazing!!! it worked, thanks alot!

1 answer

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