ply:SetWeaponColor not letting me use Color, only Vector

I need to make a certain team’s gun and player model almost invisible, I tried

ply:SetWeaponColor( Color(0,0,0,10))
ply:SetPlayerColor( Color(0,0,0,10) )

But it’s saying it was expecting a vector not a table,

Why does it change the color, but have to use a vector? it makes no sense.

That’s not what these functions are for.

They change the player and physgun colors that you can customize in the Player Model Editor.

Oh…, Well, what function does change the player model and weapon?

Entity:SetColor on both, the player and his weapon, usually Player:GetActiveWeapon()

[editline]19th January 2014[/editline]

Don’t forget about RenderMode for transparency.

Okay, so I did all 10 render modes, only 6 and 10 actually do something to the player, which makes them completely invisible.

Alternatively you can still use those functions but like this:

local pcol=Color(255,0,255)
local wcol=Color(255,255,0)
ply:SetPlayerColor(Vector(pcol.r, pcol.g, pcol.b)/255)
ply:SetWeaponColor(Vector(wcol.r, wcol.g, wcol.b)/255)

It’s a bit hacky but it’ll work.

[editline]19th January 2014[/editline]

Oh sorry just realised you’re wanting to change the alpha - the above won’t work then for what you need.

I don’t quite understand what this does, what’s it meant to do?


Oh, yeah, I was confused on how that was gonna change alpha

[editline]19th January 2014[/editline]

God I’m an idiot, I was setting render mode AFTER entity color…
solved. thanks for the help :slight_smile: