My manual team changing isn't working really, when I do it, it just auto kills me if I am in the group I am trying to switch to the team for.
function Click(mouse) -- leave this if script.Parent.Parent.Parent.Parent.Parent:IsInGroup(6617207) then script.Parent.Parent.Parent.Parent.Parent.TeamColor = BrickColor.new("Bright red") script.Parent.Parent.Parent.Parent.Parent.Character.Humanoid.Health = 0 end end
script.Parent.MouseButton1Down:connect(Click)
It should switch team but auto kills me instead without changing team.
You should be changing the Player's TeamColor to the TeamColor of the team you would like to switch to, not the BrickColor.
local team = game.Teams.YOURTEAMHERE function Click(mouse) -- leave this if script.Parent.Parent.Parent.Parent.Parent:IsInGroup(6617207) then script.Parent.Parent.Parent.Parent.Parent.TeamColor = team.TeamColor script.Parent.Parent.Parent.Parent.Parent.Character.Humanoid.Health = 0 end end script.Parent.MouseButton1Down:connect(Click)
If this is a server script, you do not need to use TeamColors. Players have a .Team property which can be used on the server. You cannot change this property in a localscript because it will not replicate.
local team = game.Teams.YOURTEAMHERE function Click(mouse) -- leave this if script.Parent.Parent.Parent.Parent.Parent:IsInGroup(6617207) then script.Parent.Parent.Parent.Parent.Parent.Team = team script.Parent.Parent.Parent.Parent.Parent.Character.Humanoid.Health = 0 end end script.Parent.MouseButton1Down:connect(Click)