I'm trying to make a script that checks to see what team the player is on. What would I have to add?? game.Workspace?? is there something in the player that tells you what team their on.
game.Players.TeamColor;
edit: if you meant how to check their team:
if game.Players.TeamColor == "Bright blue" then --Do stuff here for their team elseif game.Players.TeamColor == "Bright red" then --Do stuff separately for their team here end
if you mean how to set their team:
game.Players.TeamColor = "Bright blue"; game.Players.TeamColor = "Bright red";
edit2:
function playerOnTeam(teamColor) local players = 0; for _,v in pairs(game.Players:GetPlayers()) do if v.TeamColor == teamColor then return players + 1; end end end if playerOnTeam("Bright blue") > playerOnTeam("Bright red") then --Do stuff end
function getTeam(player) if player.Neutral then return end for _,v in pairs(game:service("Teams"):children())do if v.TeamColor==player.TeamColor then return v.Name end end end
Returns the name of the team the player is on.