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

How to make a text button for each hat in a player?

Asked by 6 years ago

I don't know why, but this script only makes it for one hat, not all.

function hatsframe() local hats = char:GetChildren()

for i, v in pairs(hats) do
    if v:isA("Accessory") then
        local a = Instance.new("TextButton")
        a.Text = v.Name
        a.Parent = script.Parent
    end

end

end

can someone please help me??

2 answers

Log in to vote
0
Answered by 6 years ago

the script was inside lots of functions don't mind the ends

0
is 'hats' an object or table? Troxure 87 — 6y
Ad
Log in to vote
0
Answered by 6 years ago
Edited 6 years ago

You might want to change the position of the buttons

like Button.Position = UDim2.new(0,0,0,(Button.Size.X.Offset * i) + 5 )

Because as of now, you can only see one button, as the buttons are overlapping each other.

Answer this question