Replace weapon viewmodel.


lua_run Entity(1):GetViewModel():SetWeaponModel(somepath) 

Set up model, but after animation called, reset back to normal


lua_run Entity(1):GetViewModel().ViewModel = some path

Set model, but after deploy and when the animations called, play wrong sequences(I.e. old model has 8 sequences, new 6, this cause error, like that - Bad sequence in GetSequenceName), also this broke reload, deploy animations. (Momentaly reload & deploy)


 local SWEP={} SWEP.Base = oldweaponclass SWEP.ViewModel=somepath weapons.Register(SWEP,new class)

Create new weapon, but require network it to client, also create new weapon without hands and ammo drawing…


lua_run Entity(1):GetViewModel():SetModel(somepath)

Doing nothing.

I imagine two ways to fix, but no ideas how to realize. 1) Replace sequence(I.e. call ACT_VM_PrimaryAttack to new model), 2) Use Viewmodel2 and simulate viewmodel1 sequences.

Can anyone help? I’ve already googled.

I’m not quite sure what you’re trying to do. Please list the following:

What do you want to happen?
What is the intended effect?
What actually happens?

  1. Replace viewmodel model. I.e. another path.
  2. Intended to create weapon with another view model but with same parameters.
  3. Model glitches after applying. (Sequences are reset to old view model, but return back soon)

I already found a fix - create custom weapons with weapons.Register.