• SetWeaponHoldType use after initial spawn?
    11 replies, posted
Hey all, So I'm trying to get a player model able to switch it's SetWeaponHoldType value while in game and alive. For example, going from a "combat ready" stance to a "passive" stance. Can anyone point me in the right direction to implement this into my swep?
When do you want to do this?
I think he wants to be able to toggle the hold type in game
Just self:SetHoldType( "whatever" ).
I would also like to know how to do this can you give us an example?
Still cant figure it out Lmao! Im a shit coder .
You said you wanted to switch it in game, but that's not specific enough. At what point in game do you want it to change? When you right click? When you jump?
[QUOTE=code_gs;49362376]You said you wanted to switch it in game, but that's not specific enough. At what point in game do you want it to change? When you right click? When you jump?[/QUOTE] When you right click sorry! :dead:
[code]SWEP.HoldType = "whatever" SWEP.HoldType2 = "whatever2" SWEP.m_bCurHoldType = false function SWEP:SecondaryAttack() self:SetHoldType( ( self.m_bCurHoldType and self.HoldType or self.HoldType2 ) ) self.m_bCurHoldType = not self.m_bCurHoldType end[/code]
we want to make a toggle for any gun not set them 1 by 1 in there swep
[QUOTE=Stalinalive;49366428]we want to make a toggle for any gun not set them 1 by 1 in there swep[/QUOTE] You could do some hacky stuff with the KeyPressed hook, but it will apply even for weapons with a secondary fire.
Yeah but i just want an example because theres not much about it on the wiki and i havent seen someone use it before outside of a swep
Sorry, you need to Log In to post a reply to this thread.