Animation from a different holdtype

Is it possible to play an animation from a different holdtype while using another.

e.g playing the knife attack animation while using the melee2 holdtype.


self.Owner:SetWeaponHoldType("knife")
self.Owner:SetAnimation(PLAYER_ATTACK1)
self.Owner:SetWeaponHoldType("melee2")

There must be a better way than that ^

I was hoping it would be as simple as self.Owner:SetAnimation(KnifeAnimationName) but there seems to be more to it then that, can anyone point me in the right direction? Thanks


self:SetWeaponHoldType("knife")
self.Owner:SetAnimation(PLAYER_ATTACK1)
self:SetWeaponHoldType("melee2"

  1. Wrap it in code tags

  2. What EXACTLY Are you trying to do? I dont understand :pwn:

I want to play the attack animation for the knife, but I’m wondering if its possible to do that without changing the hold type

You can define your own holdtype in your SWEP(Base). Don’t ask how to do it, see weapon_base source code. You can find in in gamemodes/base/entities/weapons/weapon_base/.

Thanks, I’l look into it now!