I have a script that gives you a forcefield when you join, but I'd like it so when you change to a certain team, the forcefield is removed, but changing to another certain team brings it back.
function playerRespawn(newPlayer) wait() local ff = Instance.new("ForceField", newPlayer.Character) end game.Players.PlayerAdded:connect(function(newPlayer) newPlayer.Changed:connect(function(set) if (set == "Character") then playerRespawn(newPlayer) end end) end)
local ffTeamColor = BrickColor.new(0) game.Players.PlayerAdded:connect(function(player) player.CharacterAdded:connect(function(character) if player.TeamColor == ffTeamColor then Instance.new('ForceField', character) end player.Changed:connect(function(property) if property == 'TeamColor' then if player[property] == ffTeamColor then Instance.new('ForceField',(player.Character and player.Character)) elseif player.Character and player.Character:FindFirstChild'ForceField' player.Character:FindFirstChild'ForceField':Destroy() end end end) end) end)