I know how to change the color of a weapons world model
[CODE]if SERVER then
function SWEP:Initialize()
self:SetRenderMode( RENDERMODE_GLOW )
self:SetColor(Color(255,0,0,255))
return self.BaseClass.Initialize(self)
end
end[/CODE]
How yould I change the color of the 1st person viewmodel?
local vm=self.Owner:GetViewModel() Do this CLIENTSIDE only, not server.
So would that look like
[CODE]
if CLIENT then
function SWEP:Initialize()
local vm=self.Owner:GetViewModel()
vm:SetRenderMode( RENDERMODE_GLOW )
vm:SetColor(Color(255,0,0,255))
return self.BaseClass.Initialize(self)
end[/CODE]
yes, except without the syntax error.
Ah, yeah
[editline]21st January 2014[/editline]
that caused this error to run
[ERROR] gamemodes/terrortown/entities/weapons/weapon_ttt_psychostick/shared.lua:547: attempt to call method 'GetViewModel' (a nil value)
1. unknown - gamemodes/terrortown/entities/weapons/weapon_ttt_psychostick/shared.lua:547
Sorry, you need to Log In to post a reply to this thread.