So I have a pretty good uniform script that changes the player's clothes when they enter the game and choose a team. However, I want the players to spawn with hats as well, when they choose a team. I'm terribly stuck on how to do this.
COMMUNITY QUESTION
How do I make different teams spawn with different hats? [NOT ANSWERED]
1 answer
What you would want to do is get whatever hat(s) you want to use and place them somewhere, lets put it in ServerStorage. Now, I'll just make an example of two hats I made up, Hat1 and Hat2. These Hats are now in ServerStorage and we will be using a regular Script.
game.Players.PlayerAdded:connect(function(Plr)
Plr.CharacterAdded:connect(function(Char)
local Contents = Char:GetChildren()
for _, v in pairs(Contents) -- Remove all existing hats to add new one(s)
if v:IsA("Hat") then
v:remove()
end
end
if Plr.TeamColor == BrickColor.new("Really blue") then -- Check the team Color
local Hat1 = game.ServerStorage:Clone()
Hat1.Parent = Char
elseif Plr.TeamColor == BrickColor.new("Really red") then
local Hat2 = game.ServerStorage:Clone()
Hat2.Parent = Char
end
end)
end)
This discussion is preserved as it was. New answers, comments, and votes are closed.

3 comments
Still not working for me. The hats are originally parts with a special mesh so is that why it isn't working? (They are not official ROBLOX hats)
you know for a fact, alpha, you shouldn't use remove().
This still isn't working..anything else I could do?