Garry's Mod Wiki


Player:SetPlayerColor( Vector Color )


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.


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.


When a player spawns their color will be red.

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


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



Render Time: 32ms

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