Button Gui enabling the wrong scripts in my ScrollingList

Hello apologies if my explanation might seem confusing.
What I’am trying to do is make it so that when some clicks the Text Button here
image
It checks to see if the items in this scrolling list here
image
Has a specific script inside them named “EUpClick” and if “EUpClick” is present in the item in my scrolling list, then the EUpClick in the item gets enabled.

However…For some reason out of all the items in the scrolling list only one item… in this case the item named, “Demon Fang” seems to have EUpClick Enabled while the rest of the items are instead Enabling a different script in them named “EDownClick”
image
Here is the script that I used to check for the ‘EUpClick’ Script in the list.

local RightListContainer = script.Parent.Parent.Parent 
local Artes = RightListContainer.RightList.ArtesList:GetChildren()
local TextButton = script.Parent

TextButton.MouseButton1Click:Connect(function()
for i = 1, #Artes do

	if Artes[i].ClassName == "TextButton" then
		print (Artes[i].Name.."Is a Button")
		local Script = Artes[i]:GetChildren()
		for l=1, #Script do
			if Script[l].ClassName == "LocalScript" and Script[l].Name == "EUpClick" then
				Script[1].Disabled = false
				print ("Found some scripts!") 
				end
			end
			end
	end
end)

I believe this is because of your for i loop, iterator.

You use ‘1’ here, perhaps you should consider changing it to a letter, such as i. This may impact the behaviour of your script, since it only changes the disabled property for one of your scripts. Notice how it correlates to your ‘1’ in the for i loop

I’m pretty sure that’s the letter L.

Besides, isn’t

Script[1].Disabled = false
-- supposed to be
Script[l].Disabled = false
1 Like

Oh yeh i just can’t see properly :rofl:

1 Like

Ooh that was what was wrong with my script, I feel a little silly now, thank you I fixed it and it works now.
image