Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 6 years ago

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

Log in to vote
0
Answered by 6 years ago

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)

0
that's not what I mean, but even if I do that it will still not work... Unbunn_makes 48 — 6y
Ad

Answer this question