Garry's Mod Wiki

Player:SetPlayerColor

  Player:SetPlayerColor( Vector Color )

Description

Sets the player model's color. The part of the model that is colored is determined by the model itself, and is different for each model.

Arguments

1 Vector Color
This is the color to be set. The format is Vector(r, g, b), and each color should be between 0 and 1.

Example

When a player spawns their color will be red.

hook.Add( "PlayerSpawn", "PlayerColor", function( ply ) ply:SetPlayerColor( Vector( 1, 0, 0 ) ) end)

Example

A function you could use to set the player's color to a Color rather than a Vector.

function SetColor( ply, color ) ply:SetPlayerColor( Vector( color.r / 255, color.g / 255, color.b / 255 ) ) end