How to Add Drugs as Entities?

Hi, I’m trying to create a custom class “Drug Dealer” and they sell the drugs.

Can’t get the entities to work though?

Am I doing the code wrong?

I’ve put it in the Custom Entities in DarkRPModification

Also tried the Addentities in the Darkrp config, but that didn’t work either.



DarkRP.createEntity("Water to Cure", {
        ent = "durgz_water",
        model = "models/drug_mod/the_bottle_of_water.mdl",
        price = 25,
        cmd = "water"
        allowed = {TEAM_DRUG},

})

DarkRP.createEntity("Can of Beer", {
        ent = "durgz_alcohol",
        model = "models/drug_mod/alcohol_can.mdl",
        price = 50,
        cmd = "beer"
        allowed = {TEAM_DRUG},

})

DarkRP.createEntity("Marijuana", {
        ent = "durgz_weed",
        model = "models/katharsmodels/contraband/zak_wiet/zak_wiet.mdl",
        price = 75,
        cmd = "weed"
        allowed = {TEAM_DRUG},

})

DarkRP.createEntity("LSD", {
        ent = "durgz_lsd",
        model = "models/smile/smile.mdl",
        price = 75,
        cmd = "lsd"
        allowed = {TEAM_DRUG},

})

DarkRP.createEntity("Heroine", {
        ent = "durgz_heroine",
        model = "models/katharsmodels/syringe_out/syringe_out.mdl",
        price = 90,
        cmd = "hero"
        allowed = {TEAM_DRUG},

})

DarkRP.createEntity("Cocaine", {
        ent = "durgz_cocaine",
        model = "models/cocn.mdl",
        price = 90,
        cmd = "coke"
        allowed = {TEAM_DRUG},

})


What do you mean by:

Providing console log errors will help.

This is the only error



[ERROR] gamemodes/darkrp/gamemode/config/addentities.lua:173: '}' expected (to close '{' at line 168) near 'allowed'
  1. unknown - gamemodes/darkrp/gamemode/config/addentities.lua:0


You’re missing commas after every cmd = “”

Commas aren’t neccessary at the ends of tables, also (so no commas needed at the end of allowed = )

I did this, but the entities aren’t showing in the menu :frowning:

[editline]13th March 2015[/editline]

Anyone know why The Entities aren’t showing up in the menu, or why it isn’t working?