How to give person gear via script

I’ve looked all around the internet to find a tutorial for giving roblox gear via script but I cannot find one. (Gear meaning actual gear you can put on, not tools.) Could someone either please help me direct a source or help me script something where when a player clicks a button, it equips them with gear.

I know this may be complicated as gear can be welded to certain parts of the body and can contain different elements.


Gear like hats? Can you elaborate on that or provide an example gear?

Yes, like hats and other Roblox items that you can put on through the avatar page on Roblox.

1 Like

I’d start with:

And if that doesn’t work then: (ignore the post name, it’s helpful code)

And if you’re still experiencing issues let me know!


aren’t roblox gear work like tools? just like search it up in the tool bar and see what you find

Alright, I put this script under StarterCharacterScripts like it asked for, and defined a button within a GUI, and made it so when the button is clicked, it should use the humanoid:AddAccessory to add the accessory to the player. This did not work for some reason. Any idea why?

local playerModel = script.Parent
local humanoid = playerModel:WaitForChild("Humanoid")

local button = game.StarterGui.ToolsUI.ContentFrame:WaitForChild("Headband")

-- Create the Accessory.
local clockworksShades ="Accessory")
clockworksShades.Name = "ClockworksShades"

local handle ="Part")
handle.Name = "Handle"
handle.Size =,1.6,1)
handle.Parent = clockworksShades

local faceFrontAttachment ="Attachment")
faceFrontAttachment.Name = "FaceFrontAttachment"
faceFrontAttachment.Position =,-0.24,-0.45)
faceFrontAttachment.Parent = handle

local mesh ="SpecialMesh")
mesh.Name = "Mesh"
mesh.Scale =,1.3,1)
mesh.MeshId = "rbxassetid://1577360"
mesh.TextureId = "rbxassetid://1577349"
mesh.Parent = handle

-- Attach the Accessory to the humanoid.
1 Like

You might need to parent it to the character and clone it

1 Like

How would I go about doing that? Sorry, I am new to this type of scripting… I mainly do UI scripting.

1 Like

You are trying to access the StarterGui’s button, while you should access the PlayerGui’s button, you could do something like this i guess

-- get the player
local player = game.Players:GetPlayerFromCharacter(playerModel)
-- and get the button via the PlayerGui
local button = player:WaitForChild("PlayerGui").ToolsUI.ContentFrame:WaitForChild("Headband")

This worked! Thank you so much!