for _,ImageB in pairs(InventoryGUI.ItemOrder:GetDescendants()) do
plerr.DropItem.Changed:Connect(function()
if ImageB:IsA("ImageButton") then
print("APP")
end
end)
end
Issue:Does not print “APP” in console when their is ImageButtons are clearly a descandant of InventoryGUI. I do not understand why I am having this issue please help.
Script returns no errors but cannot find image button to be a descendant.
Wait… I’m not sure about this, though maybe you could try:
plerr.DropItem.Changed:Connect(function()
for _, ImageB in ipairs(InventoryGui.ItemOrder:GetDescendants()) do
if ImageB:IsA("ImageButton") then
print("APP")
end
end
end)
Edit after 2 minutes:
I do not understand why this would fix the issue, though you can try.
I was just about to post that exact same thing haha. But that looks to be the solution since it would loop everything the value is changed rather than making a single loop and making tons of changed events
ipairs is basically pairs, but ipairs goes through the table in order, while pairs does it in random order. ipairs is faster than pairs, because when you use pairs the computer has to generate a random order. Of course, we’re talking about unnoticeable differences, but I still prefer it.