Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How to make only team helmets and how to make them wearable?

How can I make a player spawn with a helmet that I found in the avatar shop?

1 answer

✓ Accepted answer

I already answered your other question, you probably didn't see it but now I know exactly what your looking for.

local Hat = 42 -- put helmet assetID / hat ID here

local Players = game:GetService("Players")
local InsertService = game:GetService("InsertService")

local function AddHelmet(Player)
   Player.CharacterAdded:Connect(function(Character)
   wait()

     local Team = Player.Team
     local TeamColor = Player.TeamColor

-- you can find the team TWO ways, using the name, or the color! Change them as you want.
        if Team.Name == "TEAM NAME" or TeamColor == Color3.fromRGB(0,0,0) then
          InsertService:LoadAsset(Hat):GetChildren()[1].Parent = Character
        end
        
   end)
end
  
Players.PlayerAdded:Connect(AddHelmet)

17 comments

0

Thank you so much.

0

Where should I put this?

0

serverscriptservice.

0

It doesn't work

0

I put everything in a script under serverscriptservice; I change the ID and I put inside the script my team name but it doesn't work

0

any errors?

0

Idk, maybe

0

copy and paste the code again, just in-case.

0

It says that (AddHelmet) is wrong.

0

Oh, hangon.

0

try now.

0

Did you fix it?

0

i fixed it, well attempted to, re copy and paste it

0

Ok I'll try again.

0

Ok, it work, thank u for your time.

0

No problem, enjoy scripting!

0

I'm trying to script a hair remover.

This discussion is preserved as it was. New answers, comments, and votes are closed.