Lua error message in console

Hello.

I get this message in console.

[gamemodes\westernrp\gamemode\sv_ply_functions.lua:106] attempt to index field ‘?’ (a nil value)(Hook: PlayerSpawn)

This is the code chunk here:


function pmeta:LoadOut()

    self:StripWeapons()

    self:Give( "weapon_physgun" ) 
    self:Give( "gmod_rp_hands" )
    self:Give( "gmod_rp_keys" )

   LINE 106: for k, v in pairs( Jobs[self:getJob()][6] ) do
    
        self:Give( v )
        
    end    
    
end    


Other problem is:

In console getting spammed is Unknown Command: derma_skin

And last problem is:

Everytime I try to add something of custom content into the game it never shows up.

WesternRP > content > models

Thats the right format right? Do I have to call the models in the lua file?

Any ideas?

  • TNO

Try printing what:

[lua]Jobs[self:getJob()][6][/lua]

returns. It should return a table or the loop won’t work.

Edit:
Oh and it’s better to use the [noparse][lua][/lua][/noparse] tags, makes it easier for us.