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

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

Asked by 3 years ago

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

1 answer

Log in to vote
0
Answered by 3 years ago
Edited 3 years ago

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)
0
Thank you so much. nick070607 3 — 3y
0
Where should I put this? nick070607 3 — 3y
0
serverscriptservice. shadowstorm440 590 — 3y
0
It doesn't work nick070607 3 — 3y
View all comments (13 more)
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 nick070607 3 — 3y
0
any errors? shadowstorm440 590 — 3y
0
Idk, maybe nick070607 3 — 3y
0
copy and paste the code again, just in-case. shadowstorm440 590 — 3y
0
It says that (AddHelmet) is wrong. nick070607 3 — 3y
0
Oh, hangon. shadowstorm440 590 — 3y
0
try now. shadowstorm440 590 — 3y
0
Did you fix it? nick070607 3 — 3y
0
i fixed it, well attempted to, re copy and paste it shadowstorm440 590 — 3y
0
Ok I'll try again. nick070607 3 — 3y
0
Ok, it work, thank u for your time. nick070607 3 — 3y
0
No problem, enjoy scripting! shadowstorm440 590 — 3y
0
I'm trying to script a hair remover. nick070607 3 — 3y
Ad

Answer this question