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.

function GM:PlayerSpawn( 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

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

Page Links


Special Pages


Wikis

?

Render Time: 44ms

DB GetPage 12
Generate Html 9
SaveChanges (1) 14
Render Body 0
Render Sidebar 6