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

How would I equip an accessory from a script?

Asked by 4 years ago

I am attempting to make A GUI that replaces a player current hat with a one I made. I made the GUI and other functions work fine but for some reason cannot get the hat to equip. I am able to remove the accessory and clone it to the player but for some reason the cloned hat shown umovable in the current workspace on not equiped on the player. I get no error either. What do you think?

function EquipItem()
    player.Character:WaitForChild("Humanoid"):RemoveAccessories()
    wait()
    local hatClone = BaseballCap:Clone()
    hatClone.Name = "BaseballCapClone"
    player.Character:WaitForChild("Humanoid"):AddAccessory(hatClone)
end

0
AddAccessory doesn't work on the client if that's what your doing. Nickuhhhhhhhhhhhhhhh 834 — 4y

Answer this question