So im making this simple crafting system and this happened
[QUOTE][ERROR] gamemodes/owc/gamemode/modules/crafting_and_inventory/cl_dermamenu.lua:107: attempt to concatenate a nil value
1. DoClick - gamemodes/owc/gamemode/modules/crafting_and_inventory/cl_dermamenu.lua:107
2. unknown - lua/vgui/dlabel.lua:218
[/QUOTE]
I have tried everything, I don't get why it is nil even though I have a value for it
here is my current code
[CODE] for k,v in pairs(OWC.Config.Craft.entsArr)do
local icon = vgui.Create("SpawnIcon", entityList)
icon:SetModel(v[1])
icon:SetToolTip(v[3].."\nMaterials Needed: "..v[4].."\nWood Needed: "..v[5])
entityList:Add(icon)
icon.DoClick = function(icon)
net.Start("craft_entity")
net.WriteInt(k,32)
net.SendToServer()
end
end
for k,v in pairs(OWC.Config.Craft.weaponsArr)do
local icon = vgui.Create("SpawnIcon", weaponList)
icon:SetModel(v[1])
icon:SetToolTip(v[3].."\nMaterials Needed: "..v[4].."\nWood Needed: "..v[5])
weaponList:Add(icon)
icon.DoClick = function(icon)
net.Start("craft_gun")
net.WriteInt(k,32)
net.SendToServer()
end
end
end[/CODE]
My config where the [] numbers are
[CODE]--Weapon CRAFTING
OWC.Config.Craft.weaponsArr = OWC.Config.Craft.weaponsArr or {}
-- OWC.Config.Craft.weaponsArr[1] = {"","","","",""}
OWC.Config.Craft.weaponsArr[1] = {"models/weapons/w_cst_mac11.mdl","cw_mac11","MAC-11","25","20"}
--ENTITY CRAFTING
OWC.Config.Craft.entsArr = OWC.Config.Craft.entsArr or {}
-- OWC.Config.Craft.entsArr[1] = {"","","","",""}[/CODE]