M9K Nill Value

Hey guys I have been getting this Lua error sometimes when I use the M9K fists (after I punch, or when I take them out)
[lua]
[ERROR] addons/m9k specialties/lua/weapons/m9k_fists/shared.lua:137: attempt to index global ‘vm’ (a nil value)

  1. unknown - addons/m9k specialties/lua/weapons/m9k_fists/shared.lua:137

[ERROR] addons/m9k specialties/lua/weapons/m9k_fists/shared.lua:137: attempt to index global ‘vm’ (a nil value)

  1. unknown - addons/m9k specialties/lua/weapons/m9k_fists/shared.lua:137
    [/lua]

I dont think we modified the shared.lua, but if it is required I can include it.

Post the code.

Pastebin link

Anyone still there? :frowning:

I believe it’s because vm isn’t defined,
add this after line 135



vm = self.Owner:GetViewModel()


??? ???2?24??? ???(??40???)???5000??

??2000 ?6???(???)?2011?1???5000??? ???K???76.7???5000???

??2011 ?9?8??? ???76.7???68.7??K?1.1???6.9??? ???

???: ???
??? | ???

Create a new line and add:

[lua]local vm = self.Owner:GetViewModel( );[/lua]

Right after:
[lua]function SWEP:SecondaryAttack()[/lua]

thanks