Hello, im not that good at scripting, so i need help with this code :
-
I want that a random accesory for a list i select of ID from catalog, equip in the player
Script:
local accessoryId = 4645440842 or 170892848
game.Players.PlayerAdded:Connect(function(Player)
Player.CharacterAdded:Connect(function(Char)
local Hat = game:GetService("InsertService"):LoadAsset(math.random(accessoryId))
local accessory = Hat
for i,v in pairs(accessory:GetChildren()) do
if(v.ClassName == "Accessory")then
Char.Humanoid:AddAccessory(v)
break
end
wait()
end
end)
end)
Please help me, and thanks for reading!