Ad
Log in to vote
0

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

Asked by 8 months 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 8 months ago

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

0
is 'hats' an object or table? Troxure 3 — 8mo
Ad
Log in to vote
0
Answered by 8 months ago
Edited 8 months 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