Hey guys need some extreme help [ASAP please]

Hey guys im using LiquidRoleplay and when i try buy a shipment i get this lua error

[ERROR] gamemodes/darkrp/gamemode/main.lua:756: attempt to call method ‘SetContents’ (a nil value)

  1. callback - gamemodes/darkrp/gamemode/main.lua:756
  2. RP_PlayerChat - gamemodes/darkrp/gamemode/chat.lua:36
  3. unknown - gamemodes/darkrp/gamemode/chat.lua:73

And I havent a clue why this is only the one problem and i need help asap as its a class for the gundealer and it also takes my money but doesnt spawn the shipment im new here sorry if its a stupid question

Post lines 750-760 of your main.lua.

ply:AddMoney(-cost)
Notify(ply, 0, 4, string.format(LANGUAGE.you_bought_x, args, CUR … tostring(cost)))
local crate = ents.Create(“spawned_shipment”)
crate.SID = ply.SID
crate.dt.owning_ent = ply
crate:SetContents(foundKey, found.amount, found.weight)

crate:SetPos(Vector(tr.HitPos.x, tr.HitPos.y, tr.HitPos.z))
crate.nodupe = true
crate:Spawn()

crate:SetContents works with only two arguments.
From the DarkRP wiki:


If you set shipmentClass to something other than the default, make sure the shipment entity has implemented the function SetContents(ShipmentID, Count).

From commands.lua:


 crate:SetContents(shipID, ent.dt.amount)

Im a total noob so how would i fix that?

What are foundKey, found.amount, and found.weight defined as (CTRL+F the code to find where they are defined)?

local foundKey
for k,v in pairs(CustomShipments) do
if string.lower(args) == string.lower(v.name) and not v.noship then
found = v
foundKey = k
local canbecome = false
for a,b in pairs(v.allowed) do
if ply:Team() == b then
canbecome = true
end
end
if not canbecome then
Notify(ply, 1, 4, string.format(LANGUAGE.incorrect_job, “/buyshipment”))
return “”
end
end
end

[editline]21st December 2013[/editline]

ply:AddMoney(-cost)
Notify(ply, 0, 4, string.format(LANGUAGE.you_bought_x, args, CUR … tostring(cost)))
local crate = ents.Create(“spawned_shipment”)
crate.SID = ply.SID
crate.dt.owning_ent = ply
crate:SetContents(foundKey, found.amount, found.weight)

[editline]21st December 2013[/editline]

That’s what i could find

Try deleting found.weight so it is just


crate:SetContents(foundKey, found.amount)

Still get the same error :confused: