TeamColor (Property): Difference between revisions
>Mattchewy No edit summary |
>Crazypotato4 grammar fixes. the layout of this page seems kind of odd... |
||
Line 1: | Line 1: | ||
The TeamColor property | The TeamColor property is a member of [[Player|Player]], [[Team|Team]], and [[SpawnLocation|SpawnLocation]] objects. | ||
TeamColor is a BrickColor value for all three objects. | TeamColor is a BrickColor value for all three objects. | ||
==In SpawnLocations== | ==In SpawnLocations== | ||
If the [[Neutral|Neutral]] property of the [[SpawnLocation|SpawnLocation]] is not set as true, then only players with the same TeamColor as the | If the [[Neutral|Neutral]] property of the [[SpawnLocation|SpawnLocation]] is not set as true, then only players with the same TeamColor as the SpawnLocation's TeamColor will be able to spawn there. | ||
==In Teams== | ==In Teams== |
Revision as of 04:27, 17 July 2011
The TeamColor property is a member of Player, Team, and SpawnLocation objects. TeamColor is a BrickColor value for all three objects.
In SpawnLocations
If the Neutral property of the SpawnLocation is not set as true, then only players with the same TeamColor as the SpawnLocation's TeamColor will be able to spawn there.
In Teams
A Team's most important value is it's TeamColor, which decides the color of the Team. A Player with the same TeamColor as a Team will appear in the list of players on that team, and have their name shown in that color in the chat list.
In Players
If the Neutral property of the Player is not set as true, then the player will spawn only at SpawnLocations with the same TeamColor as they have. If the TeamColor of the Player does not match any existing Team in the Teams Service, then the player will NOT show up in the leaderboard, and their name will appear as black in the chat area.
|
function onPlayerAdded( player ) local playerTeam = Instance.new( "Team", game:GetService( "Teams" ) ) playerTeam.Name = player.Name local TeamColor = BrickColor.Random() player.Neutral = false player.TeamColor = TeamColor playerTeam.TeamColor = TeamColor local playerSpawn = Instance.new( "SpawnLocation", Workspace ) playerSpawn.Position = Vector3.new( math.random( -300, 300 ), math.random( -300, 300 ), math.random( -300, 300 ) ) playerSpawn.Neutral = false playerSpawn.TeamColor = TeamColor end game.Players.PlayerAdded:connect( onPlayerAdded )