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

How do I make a text button for each hat in a player's character?

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.

1 answer

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)

1 comment

0

that's not what I mean, but even if I do that it will still not work...

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