I have a script that adds a hat to the character depending on the team they are on, but if the player dies or resets, the hat is gone. this is the script: (no errors)
game.Players.PlayerAdded:connect(function(p)
p.CharacterAdded:connect(function(c)
if p.TeamColor == BrickColor.new("Bright blue") then
p.CanLoadCharacterAppearance = false
p.CharacterAdded:wait()
local char = p.Character
local blue = game.ServerStorage.BlueTeam:Clone()
blue.Parent = c
char.Torso.BrickColor = BrickColor.new("Bright blue")
elseif p.TeamColor == BrickColor.new("Bright red") then
p.Neutral = false
p.TeamColor = BrickColor.new("Bright red")
p.CanLoadCharacterAppearance = false
p.CharacterAdded:wait()
local char = p.Character
local red = game.ServerStorage.RedTeam:Clone()
red.Parent = c
char.Torso.BrickColor = BrickColor.new("Bright red")
end
end)
end)

4 comments
no errors appear but it doesn't add the hat to the character at all now
Could you post your hat-giving script?
It's what I posted
You haven't demonstrated use of hats.