Fetching a weapon's holdtype.

I just realized there’s Weapon:SetHoldType, yet no Weapon:GetHoldType. None of the new methods added for animations actually fetch you the holdtype either.

Is there any way to do this?

Weapon.HoldType should do it. It’s just a variable declared on the entity.

It should, specially now since it’s shared, but it doesn’t. I can’t fetch it through ply:GetActiveWeapon:GetTable().HoldType either.

[lua]function _R.Weapon:GetHoldType()
return self.HoldType

Would be how you’d do the metafunction easily, by the way. But that’s really strange. Are you sure the weapon you’re testing it on has a defined HoldType?

I’m testing on the default Counter Strike SWEPS, the HL2 default weapons, and MadCows’. I’m entirely sure the holdtypes for them are defined.

Adding that method to the weapon’s metatable did work though, odd enough.