DarkRP adding custom weapons can't add more

I have been adding a lot of weapons to DarkRP using M9K, but after my silenced sniper rifle, the other weapons aren’t there(http://postimg.org/image/5xnjt23en/) and when I update the entities file it spits out this:


TEST [gamemodes/darkrp/gamemode/libraries/disjointset.lua][gamemodes/darkrp/gamemode/libraries/modificationloader.lua]
TEST [gamemodes/darkrp/gamemode/libraries/fn.lua][gamemodes/darkrp/gamemode/libraries/modificationloader.lua]
TEST [gamemodes/darkrp/gamemode/libraries/interfaceloader.lua][gamemodes/darkrp/gamemode/libraries/modificationloader.lua]
TEST [gamemodes/darkrp/gamemode/libraries/modificationloader.lua][gamemodes/darkrp/gamemode/libraries/modificationloader.lua]
FOUND IN ADDON [248302805]
TEST [gamemodes/darkrp/gamemode/libraries/disjointset.lua][gamemodes/darkrp/gamemode/libraries/modificationloader.lua]
TEST [gamemodes/darkrp/gamemode/libraries/fn.lua][gamemodes/darkrp/gamemode/libraries/modificationloader.lua]
TEST [gamemodes/darkrp/gamemode/libraries/interfaceloader.lua][gamemodes/darkrp/gamemode/libraries/modificationloader.lua]
TEST [gamemodes/darkrp/gamemode/libraries/modificationloader.lua][gamemodes/darkrp/gamemode/libraries/modificationloader.lua]
FOUND IN ADDON [248302805]

[DarkRP] addons/darkrpmodification-master/lua/darkrp_customthings/entities.lua:278: attempt to index a nil value
  1. unknown - addons/darkrpmodification-master/lua/darkrp_customthings/entities.lua:278
   2. include - [C]:-1
    3. loadCustomDarkRPItems - gamemodes/darkrp/gamemode/libraries/modificationloader.lua:111
     4. fn - gamemodes/darkrp/gamemode/libraries/modificationloader.lua:119
      5. Call - addons/ulib/lua/ulib/shared/hook.lua:183
       6. unknown - lua/includes/modules/gamemode.lua:35


Here is my entities file if anyone can help, thanks.


/*---------------------------------------------------------------------------
DarkRP custom entities
---------------------------------------------------------------------------

This file contains your custom entities.
This file should also contain entities from DarkRP that you edited.

Note: If you want to edit a default DarkRP entity, first disable it in darkrp_config/disabled_defaults.lua
	Once you've done that, copy and paste the entity to this file and edit it.

The default entities can be found here:
https://github.com/FPtje/DarkRP/blob/master/gamemode/config/addentities.lua#L111

Add entities under the following line:
---------------------------------------------------------------------------*/
DarkRP.createEntity("Basic Money Printer", {
	ent = "money_printer",
	model = "models/props_c17/consolebox01a.mdl",
	price = 1000,
	max = 2,
	cmd = "buymoneyprinter"
})

DarkRP.createEntity("Advanced Money Printer", {
	ent = "adv_moneyprinter",
	model = "models/props_c17/consolebox01a.mdl",
	price = 2000,
	max = 99999999,
	cmd = "advmoney", 
	allowed = {TEAM_BANKER}})

DarkRP.createEntity("Adv. Money Printer Cooler", {
	ent = "printer_cooler",
	model = "models/props_c17/consolebox01a.mdl",
	price = 500,
	max = 2,
	cmd = "advmoneycooler" })

DarkRP.createEntity("Adv. Money Printer Failsafe", {
	ent = "printer_failsafe",
	model = "models/props_c17/consolebox01a.mdl",
	price = 500,
	max = 2,
	cmd = "advmoneyfailsafe" })

DarkRP.createEntity("Adv. Money Printer Large Battery", {
	ent = "printer_largebattery",
	model = "models/props_c17/consolebox01a.mdl",
	price = 1500,
	max = 9999999999,
	cmd = "advmoneylargebattery",
	allowed = {TEAM_BANKER} })

DarkRP.createEntity("Adv. Money Printer Medium Battery", {
	ent = "printer_mediumbattery",
	model = "models/props_c17/consolebox01a.mdl",
	price = 1000,
	max = 2,
	cmd = "advmoneymediumbattery" })

DarkRP.createEntity("Adv. Money Printer Small Battery", {
	ent = "printer_smallbattery",
	model = "models/props_c17/consolebox01a.mdl",
	price = 500,
	max = 2,
	cmd = "advmoneysmallbattery" })

DarkRP.createEntity("Adv. Money Printer Overclocker", {
	ent = "printer_overclocker",
	model = "models/props_c17/consolebox01a.mdl",
	price = 750,
	max = 999999999999,
	cmd = "advmoneyoverclock",
	allowed = {TEAM_BANKER} })

DarkRP.createEntity("Beer", {
	ent = "durgz_alcohol",
	model = "models/props_lab/crematorcase.mdl",
	price = 20,
	max = 1,
	cmd = "buybeer",
	allowed = {TEAM_DRUG} })

DarkRP.createEntity("Pain Reliever", {
	ent = "durgz_asprin",
	model = "models/props_lab/crematorcase.mdl",
	price = 20,
	max = 1,
	cmd = "buyreliever",
	allowed = {TEAM_DRUG} })

DarkRP.createEntity("Cigaretee", {
	ent = "durgz_cigaretee",
	model = "models/props_lab/crematorcase.mdl",
	price = 20,
	max = 1,
	cmd = "buysmokes",
	allowed = {TEAM_DRUG} })

DarkRP.createEntity("Cocaine", {
	ent = "durgz_cocaine",
	model = "models/props_lab/crematorcase.mdl",
	price = 20,
	max = 1,
	cmd = "buycoke",
	allowed = {TEAM_DRUG} })

DarkRP.createEntity("Heroin", {
	ent = "durgz_heroin",
	model = "models/props_lab/crematorcase.mdl",
	price = 20,
	max = 1,
	cmd = "buyheroin",
	allowed = {TEAM_DRUG} })

DarkRP.createEntity("LSD", {
	ent = "durgz_lsd",
	model = "models/props_lab/crematorcase.mdl",
	price = 20,
	max = 1,
	cmd = "buylsd",
	allowed = {TEAM_DRUG} })

DarkRP.createEntity("Weed", {
	ent = "durgz_heroin",
	model = "models/props_lab/crematorcase.mdl",
	price = 20,
	max = 1,
	cmd = "buyweed",
	allowed = {TEAM_DRUG} })

DarkRP.createEntity("Shrooms", {
	ent = "durgz_mushroom",
	model = "models/props_lab/crematorcase.mdl",
	price = 20,
	max = 1,
	cmd = "buymushroom",
	allowed = {TEAM_DRUG} })

DarkRP.createEntity("PCP", {
	ent = "durgz_pcp",
	model = "models/props_lab/crematorcase.mdl",
	price = 20,
	max = 1,
	cmd = "buypcp",
	allowed = {TEAM_DRUG} })

DarkRP.createEntity("Water", {
	ent = "durgz_water",
	model = "models/props_lab/crematorcase.mdl",
	price = 20,
	max = 1,
	cmd = "buywater", })

DarkRP.createEntity("Drug lab", {
	ent = "drug_lab",
	model = "models/props_lab/crematorcase.mdl",
	price = 400,
	max = 3,
	cmd = "buydruglab",
	allowed = {TEAM_DRUG} })

DarkRP.createEntity("ATM", {
	ent = "brax_atm",
	model = "models/props_c17/TrapPropeller_Engine.mdl",
	price = 500,
	max = 5,
	cmd = "atm", 
	allowed = {TEAM_BANKER}})

DarkRP.createEntity("Sniper Rounds", {
	ent = "m9k_ammo_sniper_rounds",
	model = "models/Items/BoxMRounds.mdl",
	price = 200,
	max = 5,
	cmd = "sniperammo" })

DarkRP.createEntity("Medkit", {
	ent = "med_kit",
	model = "models/weapons/w_pist_p228.mdl",
	price = 500,
	max = 5,
	cmd = "medkit", 
	allowed = {TEAM_GUN}})

DarkRP.createEntity("HL2 Revolver", {
	ent = "weapon_357",
	model = "models/weapons/w_pist_p228.mdl",
	price = 500,
	max = 5,
	cmd = "revolver", 
	allowed = {TEAM_GUN}})

DarkRP.createEntity("HL2 Pistol", {
	ent = "weapon_pistol",
	model = "models/weapons/w_pist_p228.mdl",
	price = 400,
	max = 5,
	cmd = "9mm", 
	allowed = {TEAM_GUN}})

DarkRP.createEntity("HL2 SMG", {
	ent = "weapon_smg1",
	model = "models/weapons/w_smg_mp5.mdl",
	price = 450,
	max = 5,
	cmd = "smg", 
	allowed = {TEAM_GUN}})

DarkRP.createEntity("ACR", {
	ent = "m9k_acr",
	model = "models/weapons/w_smg_mp5.mdl",
	price = 700,
	max = 5,
	cmd = "acr", 
	allowed = {TEAM_GUN}})

DarkRP.createEntity("FAMAS", {
	ent = "m9k_famas",
	model = "models/weapons/w_smg_mp5.mdl",
	price = 750,
	max = 5,
	cmd = "famas", 
	allowed = {TEAM_GUN}})

DarkRP.createEntity("Automatic Shotgun", {
	ent = "m9k_usas",
	model = "models/weapons/w_smg_mp5.mdl",
	price = 1200,
	max = 5,
	cmd = "autoshotgun", 
	allowed = {TEAM_GUN}})

DarkRP.createEntity("Semi-Automatic Shotgun", {
	ent = "m9k_striker12",
	model = "models/weapons/w_smg_mp5.mdl",
	price = 1250,
	max = 5,
	cmd = "semiautoshotgun", 
	allowed = {TEAM_GUN}})

DarkRP.createEntity("Benelli Shotgun", {
	ent = "m9k_m3",
	model = "models/weapons/w_smg_mp5.mdl",
	price = 1100,
	max = 5,
	cmd = "benellishotgun", 
	allowed = {TEAM_GUN}})

DarkRP.createEntity("Winchester 1897", {
	ent = "m9k_1897winchester",
	model = "models/weapons/w_smg_mp5.mdl",
	price = 1500,
	max = 5,
	cmd = "winchestershotgun", 
	allowed = {TEAM_GUN}})

DarkRP.createEntity("Barret M82", {
	ent = "m9k_barret_m82",
	model = "models/weapons/w_smg_mp5.mdl",
	price = 1800,
	max = 5,
	cmd = "barretm82", 
	allowed = {TEAM_GUN}})

DarkRP.createEntity("Silenced Sniper Rifle", {
	ent = "m9k_svu",
	model = "models/weapons/w_smg_mp5.mdl",
	price = 2000,
	max = 5,
	cmd = "silencedsniperrifle", 
	allowed = {TEAM_GUN}})

DarkRP.createEntity("Semi-Automatic Sniper Rifle", {
	ent = "m9k_psg1",
	model = "models/weapons/w_smg_mp5.mdl",
	price = 1750,
	max = 5,
	cmd = "semiautomaticsniper", 
	allowed = {TEAM_GUN}}).

DarkRP.createEntity("M24", {
	ent = "m9k_m24",
	model = "models/weapons/w_smg_mp5.mdl",
	price = 1750,
	max = 5,
	cmd = "m24sniper", 
	allowed = {TEAM_GUN}})

DarkRP.createEntity("Colt Pistol", {
	ent = "m9k_colt1911",
	model = "w_pist_p228.mdl",
	price = 500,
	max = 5,
	cmd = "m1911", 
	allowed = {TEAM_GUN}})

DarkRP.createEntity("Revolver", {
	ent = "m9k_coltpython",
	model = "w_pist_p228.mdl",
	price = 450,
	max = 5,
	cmd = "python", 
	allowed = {TEAM_GUN}})

DarkRP.createEntity("Compact Revolver", {
	ent = "m9k_model627",
	model = "w_pist_p228.mdl",
	price = 475,
	max = 5,
	cmd = "compactpython", 
	allowed = {TEAM_GUN}})

DarkRP.createEntity("Deagle", {
	ent = "m9k_deagle",
	model = "w_pist_p228.mdl",
	price = 550,
	max = 5,
	cmd = "deagle", 
	allowed = {TEAM_GUN}})

DarkRP.createEntity("Glock", {
	ent = "m9k_glock",
	model = "w_pist_p228.mdl",
	price = 500,
	max = 5,
	cmd = "glock18", 
	allowed = {TEAM_GUN}})

DarkRP.createEntity("HK45C", {
	ent = "m9k_hk45",
	model = "w_pist_p228.mdl",
	price = 500,
	max = 5,
	cmd = "hk45c", 
	allowed = {TEAM_GUN}})

DarkRP.createEntity("Revolver Sniper", {
	ent = "m9k_scoped_taurus",
	model = "w_pist_p228.mdl",
	price = 580,
	max = 5,
	cmd = "revolversniper", 
	allowed = {TEAM_GUN}})

DarkRP.createEntity("LMG", {
	ent = "m9k_m249lmg",
	model = "w_smg_mp5.mdl",
	price = 1000,
	max = 5,
	cmd = "m249", 
	allowed = {TEAM_GUN}})

DarkRP.createEntity("AK47", {
	ent = "m9k_ak47",
	model = "w_smg_mp5.mdl",
	price = 750,
	max = 5,
	cmd = "ak47", 
	allowed = {TEAM_GUN}})

DarkRP.createEntity("FN FAL", {
	ent = "m9k_fal",
	model = "w_smg_mp5.mdl",
	price = 750,
	max = 5,
	cmd = "fnfal", 
	allowed = {TEAM_GUN}})

DarkRP.createEntity("G36C", {
	ent = "m9k_g36",
	model = "w_smg_mp5.mdl",
	price = 850,
	max = 5,
	cmd = "g36c", 
	allowed = {TEAM_GUN}})

DarkRP.createEntity("M4A1", {
	ent = "m9k_m4a1",
	model = "w_smg_mp5.mdl",
	price = 950,
	max = 5,
	cmd = "m4a1", 
	allowed = {TEAM_GUN}})

DarkRP.createEntity("SCAR", {
	ent = "m9k_scar",
	model = "w_smg_mp5.mdl",
	price = 950,
	max = 5,
	cmd = "scar", 
	allowed = {TEAM_GUN}})

DarkRP.createEntity("AUG", {
	ent = "m9k_auga3",
	model = "w_smg_mp5.mdl",
	price = 950,
	max = 5,
	cmd = "aug", 
	allowed = {TEAM_GUN}})

DarkRP.createEntity("TAR21", {
	ent = "m9k_auga3",
	model = "w_smg_mp5.mdl",
	price = 1150,
	max = 5,
	cmd = "tar21", 
	allowed = {TEAM_GUN}})

EDIT: The Console also spits this out:


[DarkRP] addons/darkrpmodification-master/lua/darkrp_customthings/entities.lua:278: attempt to index a nil value
  1. unknown - addons/darkrpmodification-master/lua/darkrp_customthings/entities.lua:278
   2. include - [C]:-1
    3. loadCustomDarkRPItems - gamemodes/darkrp/gamemode/libraries/modificationloader.lua:111
     4. fn - gamemodes/darkrp/gamemode/libraries/modificationloader.lua:119
      5. Call - addons/ulib/lua/ulib/shared/hook.lua:183
       6. unknown - lua/includes/modules/gamemode.lua:35



There are no lua errors in your file. Try looking for the very first error you see in the console. Anything else could be put down to a knock-on effect of that error.

You are using DarkRP.createEntity for the weapons when you should use DarkRP.createShipment.

I am using that because 1. I don’t like it being under the shipment tab 2. Doesn’t it spawn an entity when you use the toolgun to create it?
EDIT: Also this is the only error the console spits out:


[DarkRP] addons/darkrpmodification-master/lua/darkrp_customthings/entities.lua:282: attempt to index a nil value
  1. unknown - addons/darkrpmodification-master/lua/darkrp_customthings/entities.lua:282
   2. include - [C]:-1
    3. loadCustomDarkRPItems - gamemodes/darkrp/gamemode/libraries/modificationloader.lua:111
     4. fn - gamemodes/darkrp/gamemode/libraries/modificationloader.lua:119
      5. unknown - addons/ulib/lua/ulib/shared/hook.lua:183



EDIT2: Spawning weapons as entities also seems to work