How would I give the assets received in this script their own custom names? The names would be Hat1, Hat2, and Hat3 so the game has something to refer to each of them. If the player only has 2 hats equipped then there would only be two things needing to be named and if they have none then there would not be any. I don’t know how to do this especially because the amount they will have if any isn’t for sure
for _, asset in pairs(game.Players:GetCharacterAppearanceInfoAsync(player.UserId).assets) do
if asset.assetType.name == "Hat" then
local Template = game.ServerStorage.AvatarSystem.ItemEquippedTemplate:Clone()
Template.Parent = player.PlayerGui.MainGui.Avatar.Frame.Wearing
Template.Id.Value = asset.id
Template.Icon.Image = 'rbxthumb://type=Asset&w=150&h=150&id='..tostring(asset.id)
player.Avatar.Hats.Amount.Value = Value+1
end
end