I’m trying to attach a helmet to the player’s character with a multiple-part hat accessory.
How would I be able to do this? I tried the following:
local function attachHelmet(Player, Helmet)
if Helmet ~= "NoHelmet" then
local helmetToAttach = ServerStorage.Helmets:FindFirstChild(Helmet)
for i = 1, #helmetToAttach:GetChildren() do
if helmetToAttach:GetChildren()[i] ~= helmetToAttach.Center then
local Weld = Instance.new("WeldConstraint")
Weld.Part0 = helmetToAttach:GetChildren()[i]
Weld.Part1 = helmetToAttach.Center
Weld.Parent = helmetToAttach.Center
helmetToAttach:GetChildren()[i].Anchored = false
elseif Helmet == "NoHelmet" then
I tried welding the accessory together, to obtain the result, but it sadly didn’t work.
This is how explorer looks like:
Any one have an idea? Thanks!
Replace Helmet with helmetToAttach
if you want that as soon as the player enters the game this happens you can use this:
inside the HumanoidDescription you will configure and put the helmet id!
then just create a script in ServerScriptService and copy what is below!
if hit.Parent:FindFirstChild("Humanoid") then
Im not sure how the accessories works, but I think you need a Handle part (Just a part named Handle), to make the accessory work.
Would that support multiple-parts though? Doubt it would work if I’d add the rest of the model in the Handle part.
To Attach an accessory to a player easily and properly you will need to convert your accessory to a proper accessory instance. Most accessory’s are not multiple parts but if there are multiple parts just weld them together. To add the accessory onto the player just use