Hi,
i'm a lua begineer and i want to create a "lockpick" with a "materials/shiny" and a red color ( 255, 0, 0 ) but i don't arrive to do it.
-- while i take it for the first time
function SWEP:Initialize()
self:SetHoldType("normal")
self.Owner:GetViewModel( "models/weapons/c_crowbar.mdl" ):SetColor(Color(255, 0, 0))
end
-- while i switch of weapon
function SWEP:Holster()
self:SetIsLockpicking(false)
self:SetLockpickEnt(nil)
self.Owner:GetViewModel( "models/weapons/c_crowbar.mdl" ):SetColor(0)
return true
end
i just test with the color because i litteraly don't know how to disable the color change to restore the color of the other swep because while i switch for my new lockpick, the lockpick is red but while i change for the physgun is red too sooooo
i think i need to create a Swep:OnTake() but i think that "GetViewModel" doesn't care of "models/weapons/c_crowbar.mdl"
so if semeone can teach me and help me to how to get a lockpick like the "arrest_baton" in shiny material and red that can be very interesting
thank's a lot ;)
DarkRP/shared.lua at master · FPtje/DarkRP · GitHub
hmm ok i don't have seen that but i will try to do something with that ^^
Use PreDrawViewModel and PostDrawViewModel for the view model stuff.
WEAPON/PreDrawViewModel
WEAPON/PostDrawViewModel
DrawWorldModel for the world model stuff.
WEAPON/DrawWorldModel
You can even set submaterials.
Entity/SetSubMaterial
Sorry, you need to Log In to post a reply to this thread.