PcoWSkbVqDnWTu_dm2ix
We use cookies on this site to enhance your user experience
Collapse Sidebar

Neutral

Player

bool

The Neutral property determines whether the player is on a specific team.

  • When true, the player is not on a specific team. This also means that the Player/Team property will be nil and the Player/TeamColor will be white.
  • When false, the player is on a specific team. The Player/Team property will correspond to the Team that the player is on, as will the Player/TeamColor.

Code Samples


Checking if a Player is Neutral

This example checks if a player is neutral. If the player is neutral, the game prints:

Player is neutral!

If the player is neutral, the game prints:

Player is not neutral!

Note: Although this example prints the value of the local player’s neutral property, you can change the example to get the value for any player.

local player = game.Players.LocalPlayer

if (player.Neutral) then
	print("Player is neutral!")
else
	print("Player is not neutral!")
end