Hi all, I'm incredibly new at scripting, and I'm stuck on trying to find and list a player's current hats in a scrolling frame. The few attempts that I have made have ended in failure, so if there's anything I'm missing, please reach out.
✓ ANSWER ACCEPTED
How do I find and list hats the player is currently wearing?
1 answer
✓ Accepted answer
Hey, I'm currently on a mobile device, so if I have any syntax errors, you know why. Anyways, to get a list of hats the player is wearing, you would use for i,v in pairs loops like this.
for i, v in pairs(game:GetService("Players").LocalPlayer.Character:GetChildren())
if v:IsA("Accessory") or v:IsA("Hat") then
print(v)
end
end
I'm not completely sure how to make new textlabels with perfect positions with that, but I do know you would use instance.new to constantly create new textlabels after it finds each accessory.
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
You should be using scriptinghelpers for help on scripts that arent working. Otherwise if you are incredibly new, its better you try to learn to script before making anything.