I want to make a loop that makes a text button for each hat in a player's character, but it's really hard and I'm not sure how.
I've tried doing this:
for i=1, #hat do if (hat[i].className == "Accoutrement") then Instance.new("TextButton") end
but it only creates one text button, even though there are more than one accouterment in the player's character.
I would recommend performing the GetAllChildren line. Then, make the if statement run through all the children adding a variable for every child named "Accoutrement". Den, take that variable and plug it into a while loop that demishes the value of the variable whilst simoteanously creating a new textbutton. (btw, you gotta assign the textbutton a place too)