Question about an error!


If you have no intelligent comments, keep them for yourself.

I’ll try to explain you what’s my problem because my english is really bad.
I coded a simple inventory system for my roleplay gamemode and when I’m testing it online, people are getting an error when they try to open the derma menu (F1). I don’t get their error and it works fine for me.

This is the


error

they got:
[lua]madcows_roleplay\gamemode\cl_menu.lua:158: attempt to index field ‘bigbeerbottle’ (a nil value)[/lua]

I send the items to the client so they’re supposed to see the big beer bottle (inventory.lua):
[lua]
// Send to client all items.
local files = file.FindInLua(“madcows_roleplay/gamemode/items/*.lua”)
for k, v in pairs(files) do
AddCSLuaFile(“items/” … v)
end
[/lua]

Items and function tables (shared.lua):
[lua]
MAD = {}

// Main table
Inventory = {}

// Items table
Inventory.Items = {}
[/lua]

This is the cl_menu.lua:
[lua]
/---------------------------------------------------------
------mmmm—mmmm-aaaaaaaa----ddddddddd---------------------------------------->
mmmmmmmmmmmm aaaaaaaaa dddddddddd Name: Mad Cows Roleplay
mmm mmmm mmm aaa aaa ddd ddd Author: Worshipper
mmm mmm mmm aaaaaaaaaaa ddd ddd Project Start: August 10th, 2009
mmm mmm aaa aaa dddddddddd File: cl_menu.lua
—mmm--------mmm-aaa-----aaa-ddddddddd---------------------------------------->
---------------------------------------------------------
/

/---------------------------------------------------------
Name: MAD.Menu()
---------------------------------------------------------
/
local Panel
local PanelTabs
local Tabs
local NoClosePanel = CurTime()

function MAD.Menu()

if not Panel or not Panel:IsValid() then
	Panel = vgui.Create("DFrame")
	Panel:SetSize(770, 580)
	Panel:Center()
	Panel:SetVisible(true)
	Panel:MakePopup()
	Panel:SetTitle("Menu")

	Tabs = {MAD.BackpackTab(), MAD.ShopTab()}
else
	Panel:SetVisible(true)
end

NoClosePanel = CurTime() + 0.25

function Panel:Think()

	if input.IsKeyDown(KEY_F1) and NoClosePanel < CurTime() then
		self:Close()
	end

	if (!self.Dragging) then return end

	local x = gui.MouseX() - self.Dragging[1]
	local y = gui.MouseY() - self.Dragging[2]

	x = math.Clamp(x, 0, ScrW() - self:GetWide()) 
	y = math.Clamp(y, 0, ScrH() - self:GetTall()) 

	self:SetPos(x, y) 		
end

if not PanelTabs or not PanelTabs:IsValid() then
	PanelTabs = vgui.Create("DPropertySheet", Panel)
	PanelTabs:SetPos(5, 25)
	PanelTabs:SetSize(760, 550)
	PanelTabs:AddSheet("Inventory", Tabs[1], "gui/silkicons/box", false, false)
	PanelTabs:AddSheet("Shop", Tabs[2], "gui/silkicons/world", false, false)
end

for _, panel in pairs(Tabs) do panel:Update() end

function Panel:Close()
	Panel:SetVisible(false)
end 

end
concommand.Add(“rp_menu”, MAD.Menu)

/---------------------------------------------------------
Name: MAD.BackpackTab()
---------------------------------------------------------
/
function MAD.BackpackTab()

local InventoryPanel = vgui.Create("DPanelList")

function InventoryPanel:Update()

	self:Clear(true)

	local InventoryCat = vgui.Create("DCollapsibleCategory")

	InventoryCat:SetLabel("Backpack")

	local BackpackPanel = vgui.Create("DPanelList")
	BackpackPanel:SetSize(0, 130)
	BackpackPanel:SetSpacing(1)
	BackpackPanel:EnableHorizontal(true)
	BackpackPanel:EnableVerticalScrollbar(true)

	local function AddBackpackIcon(model, description, item)
		local Icon = vgui.Create("SpawnIcon")
		Icon:InvalidateLayout(true) 
		Icon:SetModel(model)
		Icon:SetIconSize(64)
		Icon:SetToolTip(description)
		Icon.DoClick = function()
			local OptionMenu = DermaMenu()
				OptionMenu:AddOption("Use", function() LocalPlayer():ConCommand("rp_useitem " .. item) timer.Simple(0.1, function() self:Update() end) end)
				OptionMenu:AddOption("Drop", function() LocalPlayer():ConCommand("rp_dropitem " .. item) timer.Simple(0.1, function() self:Update() end) end)
			OptionMenu:Open()

			surface.PlaySound(Sound("buttons/button15.wav"))
		end

		BackpackPanel:AddItem(Icon)
	end

	for k, v in pairs(InventoryTable) do
		AddBackpackIcon(Inventory.Items[k].Model, "Name: " .. Inventory.Items[k].Name .. "

" … "Description: " … Inventory.Items[k].Description … "
" … "Amount: " … v, k)
end

	InventoryCat:SetContents(BackpackPanel)
	self:AddItem(InventoryCat)
end

InventoryPanel:Update()	
return InventoryPanel

end

/---------------------------------------------------------
Name: MAD.ShopTab()
---------------------------------------------------------
/
function MAD.ShopTab()

local ShopPanel = vgui.Create("DPanelList")

function ShopPanel:Update()

	self:Clear(true)

	local FoodCat = vgui.Create("DCollapsibleCategory")

	FoodCat:SetLabel("Food")

	local FoodPanel = vgui.Create("DPanelList")
	FoodPanel:SetSize(0, 130)
	FoodPanel:SetSpacing(1)
	FoodPanel:EnableHorizontal(true)
	FoodPanel:EnableVerticalScrollbar(true)

	local function AddFoodIcon(model, description, item)
		local Icon = vgui.Create("SpawnIcon")
		Icon:InvalidateLayout(true) 
		Icon:SetModel(model)
		Icon:SetIconSize(64)
		Icon:SetToolTip(description)
		Icon.DoClick = function()
			local OptionMenu = DermaMenu()
				OptionMenu:AddOption("Buy", function() LocalPlayer():ConCommand("say /buyitem " .. item) end)
				OptionMenu:AddOption("None", function() end)
			OptionMenu:Open()
			
			surface.PlaySound(Sound("buttons/button15.wav"))
		end

		FoodPanel:AddItem(Icon)
	end

	AddFoodIcon(Inventory.Items["bigbeerbottle"].Model, "Name: " .. Inventory.Items["bigbeerbottle"].Name .. "

" … "Description: " … Inventory.Items[“bigbeerbottle”].Description … "
Price: " … tostring(GetGlobalInt(“bigbeerbottlecost”)) … DOLLAR, “bigbeerbottle”)
AddFoodIcon(Inventory.Items[“chinesefood”].Model, "Name: " … Inventory.Items[“chinesefood”].Name … "
" … "Description: " … Inventory.Items[“chinesefood”].Description … "
Price: " … tostring(GetGlobalInt(“chinesefoodcost”)) … DOLLAR, “chinesefood”)
AddFoodIcon(Inventory.Items[“gaseousdrink”].Model, "Name: " … Inventory.Items[“gaseousdrink”].Name … "
" … "Description: " … Inventory.Items[“gaseousdrink”].Description … "
Price: " … tostring(GetGlobalInt(“gaseousdrinkcost”)) … DOLLAR, “gaseousdrink”)
AddFoodIcon(Inventory.Items[“melon”].Model, "Name: " … Inventory.Items[“melon”].Name … "
" … "Description: " … Inventory.Items[“melon”].Description … "
Price: " … tostring(GetGlobalInt(“meloncost”)) … DOLLAR, “melon”)
AddFoodIcon(Inventory.Items[“milkbottle”].Model, "Name: " … Inventory.Items[“milkbottle”].Name … "
" … "Description: " … Inventory.Items[“milkbottle”].Description … "
Price: " … tostring(GetGlobalInt(“milkbottlecost”)) … DOLLAR, “milkbottle”)
AddFoodIcon(Inventory.Items[“milkcarton”].Model, "Name: " … Inventory.Items[“milkcarton”].Name … "
" … "Description: " … Inventory.Items[“milkcarton”].Description … "
Price: " … tostring(GetGlobalInt(“milkcartoncost”)) … DOLLAR, “milkcarton”)
AddFoodIcon(Inventory.Items[“orange”].Model, "Name: " … Inventory.Items[“orange”].Name … "
" … "Description: " … Inventory.Items[“orange”].Description … "
Price: " … tostring(GetGlobalInt(“orangecost”)) … DOLLAR, “orange”)
AddFoodIcon(Inventory.Items[“peas”].Model, "Name: " … Inventory.Items[“peas”].Name … "
" … "Description: " … Inventory.Items[“peas”].Description … "
Price: " … tostring(GetGlobalInt(“peascost”)) … DOLLAR, “peas”)
AddFoodIcon(Inventory.Items[“smallbeerbottle”].Model, "Name: " … Inventory.Items[“smallbeerbottle”].Name … "
" … "Description: " … Inventory.Items[“smallbeerbottle”].Description … "
Price: " … tostring(GetGlobalInt(“smallbeerbottlecost”)) … DOLLAR, “smallbeerbottle”)
AddFoodIcon(Inventory.Items[“tomatoesoup”].Model, "Name: " … Inventory.Items[“tomatoesoup”].Name … "
" … "Description: " … Inventory.Items[“tomatoesoup”].Description … "
Price: " … tostring(GetGlobalInt(“tomatoesoupcost”)) … DOLLAR, “tomatoesoup”)
AddFoodIcon(Inventory.Items[“vodka”].Model, "Name: " … Inventory.Items[“vodka”].Name … "
" … "Description: " … Inventory.Items[“vodka”].Description … "
Price: " … tostring(GetGlobalInt(“vodkacost”)) … DOLLAR, “vodka”)
AddFoodIcon(Inventory.Items[“water”].Model, "Name: " … Inventory.Items[“water”].Name … "
" … "Description: " … Inventory.Items[“water”].Description … "
Price: " … tostring(GetGlobalInt(“watercost”)) … DOLLAR, “water”)

	FoodCat:SetContents(FoodPanel)
	self:AddItem(FoodCat)

	local LaundryCat = vgui.Create("DCollapsibleCategory")

	LaundryCat:SetLabel("Laundry")

	local LaundryPanel = vgui.Create("DPanelList")
	LaundryPanel:SetSize(0, 65)
	LaundryPanel:SetSpacing(1)
	LaundryPanel:EnableHorizontal(true)
	LaundryPanel:EnableVerticalScrollbar(true)

	local function AddLaundryIcon(model, description, item)
		local Icon = vgui.Create("SpawnIcon")
		Icon:InvalidateLayout(true) 
		Icon:SetModel(model)
		Icon:SetIconSize(64)
		Icon:SetToolTip(description)
		Icon.DoClick = function()
			local OptionMenu = DermaMenu()
				OptionMenu:AddOption("Buy", function() LocalPlayer():ConCommand("say /buyitem " .. item) end)
				OptionMenu:AddOption("None", function() end)
			OptionMenu:Open()
			
			surface.PlaySound(Sound("buttons/button15.wav"))
		end

		LaundryPanel:AddItem(Icon)
	end

	AddLaundryIcon(Inventory.Items["cleaningproduct"].Model, "Name: " .. Inventory.Items["cleaningproduct"].Name .. "

" … "Description: " … Inventory.Items[“cleaningproduct”].Description … "
Price: " … tostring(GetGlobalInt(“cleaningproductcost”)) … DOLLAR, “cleaningproduct”)
AddLaundryIcon(Inventory.Items[“detergent”].Model, "Name: " … Inventory.Items[“detergent”].Name … "
" … "Description: " … Inventory.Items[“detergent”].Description … "
Price: " … tostring(GetGlobalInt(“detergentcost”)) … DOLLAR, “detergent”)

	LaundryCat:SetContents(LaundryPanel)
	self:AddItem(LaundryCat)

	local OtherCat = vgui.Create("DCollapsibleCategory")

	OtherCat:SetLabel("Other")

	local OtherPanel = vgui.Create("DPanelList")
	OtherPanel:SetSize(0, 65)
	OtherPanel:SetSpacing(1)
	OtherPanel:EnableHorizontal(true)
	OtherPanel:EnableVerticalScrollbar(true)

	local function AddOtherIcon(model, description, item)
		local Icon = vgui.Create("SpawnIcon")
		Icon:InvalidateLayout(true) 
		Icon:SetModel(model)
		Icon:SetIconSize(64)
		Icon:SetToolTip(description)
		Icon.DoClick = function()
			local OptionMenu = DermaMenu()
				OptionMenu:AddOption("Buy", function() LocalPlayer():ConCommand("say /buyitem " .. item) end)
				OptionMenu:AddOption("None", function() end)
			OptionMenu:Open()
			
			surface.PlaySound(Sound("buttons/button15.wav"))
		end

		OtherPanel:AddItem(Icon)
	end

	AddOtherIcon(Inventory.Items["drug"].Model, "Name: " .. Inventory.Items["drug"].Name .. "

" … "Description: " … Inventory.Items[“drug”].Description … "
Price: " … tostring(GetGlobalInt(“drugcost”)) … DOLLAR, “drug”)
AddOtherIcon(Inventory.Items[“poison”].Model, "Name: " … Inventory.Items[“poison”].Name … "
" … "Description: " … Inventory.Items[“poison”].Description … "
Price: " … tostring(GetGlobalInt(“poisoncost”)) … DOLLAR, “poison”)

	OtherCat:SetContents(OtherPanel)
	self:AddItem(OtherCat)

	local PistolsCat = vgui.Create("DCollapsibleCategory")

	PistolsCat:SetLabel("Pistols")

	local PistolsPanel = vgui.Create("DPanelList")
	PistolsPanel:SetSize(0, 65)
	PistolsPanel:SetSpacing(1)
	PistolsPanel:EnableHorizontal(true)
	PistolsPanel:EnableVerticalScrollbar(true)

	local function AddPistolsIcon(model, description, item)
		local Icon = vgui.Create("SpawnIcon")
		Icon:InvalidateLayout(true) 
		Icon:SetModel(model)
		Icon:SetIconSize(64)
		Icon:SetToolTip(description)
		Icon.DoClick = function()
			local OptionMenu = DermaMenu()
				OptionMenu:AddOption("Buy", function() LocalPlayer():ConCommand("say /buyitem " .. item) end)
				OptionMenu:AddOption("None", function() end)
			OptionMenu:Open()
			
			surface.PlaySound(Sound("buttons/button15.wav"))
		end

		PistolsPanel:AddItem(Icon)
	end

	AddPistolsIcon(Inventory.Items["57"].Model, "Name: " .. Inventory.Items["57"].Name .. "

" … "Description: " … Inventory.Items[“57”].Description … "
Price: " … tostring(GetGlobalInt(“57cost”)) … DOLLAR, “57”)
AddPistolsIcon(Inventory.Items[“deagle”].Model, "Name: " … Inventory.Items[“deagle”].Name … "
" … "Description: " … Inventory.Items[“deagle”].Description … "
Price: " … tostring(GetGlobalInt(“deaglecost”)) … DOLLAR, “deagle”)
AddPistolsIcon(Inventory.Items[“dual”].Model, "Name: " … Inventory.Items[“dual”].Name … "
" … "Description: " … Inventory.Items[“dual”].Description … "
Price: " … tostring(GetGlobalInt(“dualcost”)) … DOLLAR, “dual”)
AddPistolsIcon(Inventory.Items[“glock”].Model, "Name: " … Inventory.Items[“glock”].Name … "
" … "Description: " … Inventory.Items[“glock”].Description … "
Price: " … tostring(GetGlobalInt(“glockcost”)) … DOLLAR, “glock”)
AddPistolsIcon(Inventory.Items[“p228”].Model, "Name: " … Inventory.Items[“p228”].Name … "
" … "Description: " … Inventory.Items[“p228”].Description … "
Price: " … tostring(GetGlobalInt(“p228cost”)) … DOLLAR, “p228”)
AddPistolsIcon(Inventory.Items[“usp”].Model, "Name: " … Inventory.Items[“usp”].Name … "
" … "Description: " … Inventory.Items[“usp”].Description … "
Price: " … tostring(GetGlobalInt(“uspcost”)) … DOLLAR, “usp”)
AddPistolsIcon(Inventory.Items[“usp_match”].Model, "Name: " … Inventory.Items[“usp_match”].Name … "
" … "Description: " … Inventory.Items[“usp_match”].Description … "
Price: " … tostring(GetGlobalInt(“usp_matchcost”)) … DOLLAR, “usp_match”)

	PistolsCat:SetContents(PistolsPanel)
	self:AddItem(PistolsCat)
end

ShopPanel:Update()	
return ShopPanel

end
[/lua]

Perhaps I’m not seeing the entire code, but I don’t see anywhere where you actually put things into the Inventory.Items table. If you are, then my guess is the FindInLua or AddCSLuaFile paths may not be correct. Try doing a PrintTable(Inventory.Items) and see what comes out.

I don’t understand because the AddCSLuaFile is supposed to be perfect.

[lua]
lua_run PrintTable(Inventory.Items)
> PrintTable(Inventory.Items) …
cleaningproduct:
USE = function: 02867E98
Name = Cleaning Product
UniqueID = cleaningproduct
RemoveOnUse = true
Description = Makes you feel good, but as some side effects.
Model = models/props_junk/garbage_plasticbottle002a.mdl
dual:
USE = function: 027BC7D8
Name = 9mm Dual Beretta Elites
UniqueID = dual
RemoveOnUse = true
Description = Illegal weapon that helps you to defend yourself.
Model = models/weapons/w_pist_elite_dropped.mdl
gaseousdrink:
USE = function: 027DD7C0
Name = Gaseous Drink
UniqueID = gaseousdrink
RemoveOnUse = true
Description = Satisfy your hunger.
Model = models/props_junk/garbage_plasticbottle003a.mdl
tomatoesoup:
USE = function: 027C9EB8
Name = Tomatoe Soup
UniqueID = tomatoesoup
RemoveOnUse = true
Description = Satisfy your hunger.
Model = models/props_junk/garbage_metalcan002a.mdl
poison:
USE = function: 027BD288
Name = Rat Poison
UniqueID = poison
RemoveOnUse = true
Description = Makes you feel good, but as some side effects.
Model = models/props_lab/jar01a.mdl
57:
USE = function: 027BEC68
Name = 5.7mm FN Five-Seven
UniqueID = 57
RemoveOnUse = true
Description = Illegal weapon that helps you to defend yourself.
Model = models/weapons/w_pist_fiveseven.mdl
water:
USE = function: 027BF118
Name = Water Can
UniqueID = water
RemoveOnUse = true
Description = Satisfy your hunger.
Model = models/props_junk/PopCan01a.mdl
chinesefood:
USE = function: 02844C90
Name = Chinese Food
UniqueID = chinesefood
RemoveOnUse = true
Description = Satisfy your hunger.
Model = models/props_junk/garbage_takeoutcarton001a.mdl
smallbeerbottle:
USE = function: 027C5460
Name = Small Beer Bottle
UniqueID = smallbeerbottle
RemoveOnUse = true
Description = Makes you feel good, but as some side effects.
Model = models/props_junk/garbage_glassbottle003a.mdl
orange:
USE = function: 0286A7D8
Name = Orange
UniqueID = orange
RemoveOnUse = true
Description = Satisfy your hunger.
Model = models/props/cs_italy/orange.mdl
bigbeerbottle:
USE = function: 02866DD0
Name = Big Beer Bottle
UniqueID = bigbeerbottle
RemoveOnUse = true
Description = Makes you feel good, but as some side effects.
Model = models/props_junk/garbage_glassbottle001a.mdl
vodka:
USE = function: 027BF4F0
Name = Vodka
UniqueID = vodka
RemoveOnUse = true
Description = Makes you feel good, but as some side effects.
Model = models/props_junk/glassjug01.mdl
deagle:
USE = function: 027BF718
Name = .50 Desert Eagle
UniqueID = deagle
RemoveOnUse = true
Description = Illegal weapon that helps you to defend yourself.
Model = models/weapons/w_pist_deagle.mdl
detergent:
USE = function: 029812F8
Name = Detergent
UniqueID = detergent
RemoveOnUse = true
Description = Makes you feel good, but as some side effects.
Model = models/props_junk/garbage_plasticbottle001a.mdl
milkbottle:
USE = function: 027BAC78
Name = Milk Bottle
UniqueID = milkbottle
RemoveOnUse = true
Description = Satisfy your hunger.
Model = models/props_junk/garbage_milkcarton001a.mdl
melon:
USE = function: 02806E18
Name = Water Melon
UniqueID = melon
RemoveOnUse = true
Description = Satisfy your hunger.
Model = models/props_junk/watermelon01.mdl
peas:
USE = function: 027BDCD8
Name = Peas Can
UniqueID = peas
RemoveOnUse = true
Description = Satisfy your hunger.
Model = models/props_junk/garbage_metalcan001a.mdl
p228:
USE = function: 027E1990
Name = 9mm Sig-Sauer P228
UniqueID = p228
RemoveOnUse = true
Description = Illegal weapon that helps you to defend yourself.
Model = models/weapons/w_pist_p228.mdl
glock:
USE = function: 027C4038
Name = 9mm Glock 18
UniqueID = glock
RemoveOnUse = true
Description = Illegal weapon that helps you to defend yourself.
Model = models/weapons/w_pist_glock18.mdl
milkcarton:
USE = function: 027D98C0
Name = Milk Carton
UniqueID = milkcarton
RemoveOnUse = true
Description = Satisfy your hunger.
Model = models/props_junk/garbage_milkcarton002a.mdl
drug:
USE = function: 027C7B00
Name = Marijuana
UniqueID = drug
RemoveOnUse = true
Description = Makes you feel good, but as some side effects.
Model = models/props_lab/jar01b.mdl
usp:
USE = function: 028E2958
Name = .45 HK USP
UniqueID = usp
RemoveOnUse = true
Description = Illegal weapon that helps you to defend yourself.
Model = models/weapons/w_pist_usp.mdl
usp_match:
USE = function: 02806D40
Name = 9mm HK USP Match
UniqueID = usp_match
RemoveOnUse = true
Description = Illegal weapon that helps you to defend yourself.
Model = models/weapons/w_pistol.mdl
[/lua]

This is supposed to be a clientside table though, right? (lua_run_cl?)

Same shit.
It’s shared.

[lua]

] lua_run_cl PrintTable(Inventory.Items)
cleaningproduct:
Name = Cleaning Product
UniqueID = cleaningproduct
RemoveOnUse = true
Description = Makes you feel good, but as some side effects.
Model = models/props_junk/garbage_plasticbottle002a.mdl
dual:
Name = 9mm Dual Beretta Elites
UniqueID = dual
RemoveOnUse = true
Description = Illegal weapon that helps you to defend yourself.
Model = models/weapons/w_pist_elite_dropped.mdl
gaseousdrink:
Name = Gaseous Drink
UniqueID = gaseousdrink
RemoveOnUse = true
Description = Satisfy your hunger.
Model = models/props_junk/garbage_plasticbottle003a.mdl
tomatoesoup:
Name = Tomatoe Soup
UniqueID = tomatoesoup
RemoveOnUse = true
Description = Satisfy your hunger.
Model = models/props_junk/garbage_metalcan002a.mdl
poison:
Name = Rat Poison
UniqueID = poison
RemoveOnUse = true
Description = Makes you feel good, but as some side effects.
Model = models/props_lab/jar01a.mdl
57:
Name = 5.7mm FN Five-Seven
UniqueID = 57
RemoveOnUse = true
Description = Illegal weapon that helps you to defend yourself.
Model = models/weapons/w_pist_fiveseven.mdl
water:
Name = Water Can
UniqueID = water
RemoveOnUse = true
Description = Satisfy your hunger.
Model = models/props_junk/PopCan01a.mdl
chinesefood:
Name = Chinese Food
UniqueID = chinesefood
RemoveOnUse = true
Description = Satisfy your hunger.
Model = models/props_junk/garbage_takeoutcarton001a.mdl
smallbeerbottle:
Name = Small Beer Bottle
UniqueID = smallbeerbottle
RemoveOnUse = true
Description = Makes you feel good, but as some side effects.
Model = models/props_junk/garbage_glassbottle003a.mdl
orange:
Name = Orange
UniqueID = orange
RemoveOnUse = true
Description = Satisfy your hunger.
Model = models/props/cs_italy/orange.mdl
bigbeerbottle:
Name = Big Beer Bottle
UniqueID = bigbeerbottle
RemoveOnUse = true
Description = Makes you feel good, but as some side effects.
Model = models/props_junk/garbage_glassbottle001a.mdl
vodka:
Name = Vodka
UniqueID = vodka
RemoveOnUse = true
Description = Makes you feel good, but as some side effects.
Model = models/props_junk/glassjug01.mdl
deagle:
Name = .50 Desert Eagle
UniqueID = deagle
RemoveOnUse = true
Description = Illegal weapon that helps you to defend yourself.
Model = models/weapons/w_pist_deagle.mdl
detergent:
Name = Detergent
UniqueID = detergent
RemoveOnUse = true
Description = Makes you feel good, but as some side effects.
Model = models/props_junk/garbage_plasticbottle001a.mdl
milkbottle:
Name = Milk Bottle
UniqueID = milkbottle
RemoveOnUse = true
Description = Satisfy your hunger.
Model = models/props_junk/garbage_milkcarton001a.mdl
melon:
Name = Water Melon
UniqueID = melon
RemoveOnUse = true
Description = Satisfy your hunger.
Model = models/props_junk/watermelon01.mdl
peas:
Name = Peas Can
UniqueID = peas
RemoveOnUse = true
Description = Satisfy your hunger.
Model = models/props_junk/garbage_metalcan001a.mdl
p228:
Name = 9mm Sig-Sauer P228
UniqueID = p228
RemoveOnUse = true
Description = Illegal weapon that helps you to defend yourself.
Model = models/weapons/w_pist_p228.mdl
glock:
Name = 9mm Glock 18
UniqueID = glock
RemoveOnUse = true
Description = Illegal weapon that helps you to defend yourself.
Model = models/weapons/w_pist_glock18.mdl
milkcarton:
Name = Milk Carton
UniqueID = milkcarton
RemoveOnUse = true
Description = Satisfy your hunger.
Model = models/props_junk/garbage_milkcarton002a.mdl
drug:
Name = Marijuana
UniqueID = drug
RemoveOnUse = true
Description = Makes you feel good, but as some side effects.
Model = models/props_lab/jar01b.mdl
usp:
Name = .45 HK USP
UniqueID = usp
RemoveOnUse = true
Description = Illegal weapon that helps you to defend yourself.
Model = models/weapons/w_pist_usp.mdl
usp_match:
Name = 9mm HK USP Match
UniqueID = usp_match
RemoveOnUse = true
Description = Illegal weapon that helps you to defend yourself.
[/lua]

What file are all the items defined in? Shared? If it’s shared, did you make sure to send it to the client as well as cl_menu?

I forgot to include all the items in shared.lua.
I found the solution at 3 AM. :stuck_out_tongue:
[lua]
// Include all items both serverside and clientside.
local files = file.FindInLua(“madcows_roleplay/gamemode/items/*.lua”)
for k, v in pairs(files) do
include(“items/” … v)
end
[/lua]