I have been adding a lot of weapons to DarkRP using M9K, but after my silenced sniper rifle, the other weapons aren't there([url]http://postimg.org/image/5xnjt23en/[/url]) and when I update the entities file it spits out this:
[CODE]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
[/CODE]
Here is my entities file if anyone can help, thanks.
[CODE]/*---------------------------------------------------------------------------
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,
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:
[CODE][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
[/CODE]
EDIT2: Spawning weapons as entities also seems to work
Sorry, you need to Log In to post a reply to this thread.