• Is this correct?
    3 replies, posted
[CODE]function ITEM:OnEquip(ply, modifications) ply:SetPlayerColor( Vector( 1,0,0 ) ) end[/CODE] I want it so you can set the player colour in _undefined's pointshop? also is [CODE]ply:SetPlayerColor( Vector( 1,0,0 ) ) [/CODE] RGB? so i could do anything up to 255,255,255 I want to be sure before I add this in. Haven't got time to experiment and test things....
It's RGB but in the range 0 to 1 rather than 0 to 255, so you'll have to divide everything by 255. In the next update coming soon (you can try it out now by opting into the dev branch), you'll be able to convert true 0-255 RGB to 0-1 Vector with this: [lua]Color(255, 255, 255):ToVector()[/lua] Most things in GMod just use Color(r, g, b) without any coversion to vector but SetPlayerColor seems to be one of the ones that requires a Vector.
ok thanks for that. Can you give me an example how to lets say make the player model blue?
Blue has a 0-255 RGB of 0,0,255 As a Vector this is simply 0,0,1. [lua]ply:SetPlayerColor(Vector(0, 0, 1))[/lua]
Sorry, you need to Log In to post a reply to this thread.