Help with Part Welding With Teams

I need help with a script I made. The script I made makes a part welded to the people in the killer team. Its working but I want it to work for people who change from another team to killer team. If you dont understand what im saying, just check the script

local kb = game.ReplicatedStorage.KillBrick:Clone()
local killerteam = game:GetService(“Teams”)[“Killer”]

wait(3)

game.Players.PlayerAdded:Connect(function(player)
   if (player.TeamColor == killerteam.TeamColor) then
 local character = player.Character or player.CharacterAdded:Wait()
        kb.Parent = character
    local weld = Instance.new("WeldConstraint")
    weld.Parent = character
    weld.Part0 = kb
    weld.Part1 = character.HumanoidRootPart
    kb.Position = character.HumanoidRootPart.Position
    kb.IsInUse.Value = true
           elseif player.TeamColor ~= killerteam.TeamColor then print(“Not in Killer Team”)
      end
end)

Just loop through the killer team and if he doesn’t have that item in his character then add it there

How would I do that? Using RunService with IPairs?

You want to add the CharacterAdded event which will fire whenever a player respawns / resets.

See here:
https://developer.roblox.com/en-us/api-reference/event/Player/CharacterAdded

1 Like

Ya that will do it

Chhhhaaarrrsssss

I tried game.Players.CharacterAdded:Connect() but it doesnt work, maybe its something else?