Helmet Localization Script

Hello! I currently am working on an experimental helmet in Roblox Studio, and can’t think of a script to lock it onto a humanoid.
For example, when a player joins the game, the helmet should just be attached to them. When they move, it moves with them, when they rotate, it rotates with them. How would I achieve this?
Btw, I can not script, hence this post.

1 Like

Humanoid:AddAccessory, Welds are your best options. Look them up

3 Likes

You could utilize the starter character folder.

1 Like

@CheezBoy27 @alessdai Thanks! I will try that out in a sec. :slight_smile:

2 Likes

Hmm, that doesn’t seem to be working. I put it in StarterPlayer, but as I assumed, that did nothing…

No, you have a pre-programmed rig (animated of course) wearing the helmet in the starter character folder. I’ll make one… give me a sec…

1 Like

I mean’t I wanted it locked to the character playing, not a model.

local Helmet = -- path to helmet

game.Players.PlayerAdded:Connect(function(player) -- Listens for when the player joins
        local char = player.Character or player.CharacterAdded:Wait() -- Gets the character of the player.
        local hum = char:FindFirstChild("Humanoid") -- Gets their Humanoid
        hum:AddAccessory(Helmet) -- Adds the helmet
end)

As @alessdai said, using Humanoid:AddAccessory should do the trick. Make sure that this script is not a local script, since AddAccessory doesn’t work on the local Client.

1 Like

Nice, thanks! I will try that out in a sec.

2 Likes

You should make a regular script and put it in ServerScriptService, now make sure to have the right path on line 1, otherwise it won’t be able to identify the Helmet.

2 Likes

Oddly, it still can’t understand “Helmet”. Any further instructions?

Sorry for the late response, but it might try to look for it in the script before it loaded in ingame, did you use :WaitForChild()?

1 Like

I just noticed the you used “Wait()” instead of “WaitForChild()”. I will fix that in a sec. :slight_smile:

Ouch, it still doesn’t work. The script keeps underlining the second “Helmet”.
Edit: I fixed the underline problem, but it continues to not connect to the Humanoid.

1 Like