Attempt to concatenate nil with string


I’ve got some problem here, whenever I run script It prints “Attempt to concatenate nil with string” What should I do?

1 Like

Why do you check if “upgrade buttons” exist after detecting “upgrade buttons”?

1 Like

just as @Oskar_248 mentioned, why are you checking if upgradeButtons exists after detecting it?

1 Like

Just making sure It wont cause errors

1 Like

either way as error code says i’m assuming Price isn’t a defined attribute
make sure it is

You can’t loop through nil in a table, so you don’t need the if statement. Also this error like the person above me said means that there is no attribute called Price for upgradeButtons

This only makes sense if you will be removing “Upgrade Buttons” when executing this code

Just fixed it
image
I had to put if it was “TextButton”

2 Likes

Make sure upgradeBackground only have buttons because you might insert something not a button.

and verify if value is a GuiButton and it has Price by

if upgradeButtons and upgradeButtons:IsA("GuiButton") and upgradeButtons:GetAttribute("Price") then

end
2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.