Player/SetPlayerColor

From Garry's Mod
Jump to: navigation, search
 Player:SetPlayerColor( )

Contents

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

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.

Examples

Example

When a player spawns their color will be red.

function GM:PlayerSpawn( ply )
	ply:SetPlayerColor( Vector(1,0,0) )
end


Examples

Example

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

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


Personal tools
Navigation