Chessnut / NutScript

A free role-play framework for Garry's Mod.
http://nutscript.rocks
MIT License
94 stars 77 forks source link

Vehicle item error #479

Closed Trixas closed 9 years ago

Trixas commented 9 years ago

Hi, what can be wrong?

[ERROR] gamemodes/nutscript/gamemode/core/derma/cl_inventory.lua:105: bad argument #2 to 'L' (no value)
L - [C]:-1
setInventory - gamemodes/nutscript/gamemode/core/derma/cl_inventory.lua:105
callback - gamemodes/nutscript/gamemode/core/derma/cl_inventory.lua:401
DoClick - gamemodes/nutscript/gamemode/core/derma/cl_menu.lua:171
unknown - lua/vgui/dlabel.lua:218

Code for vehicle item is:

ITEM.name = "Chevrolet Impala"
ITEM.model = "models/lonewolfie/chev_impala_09_police.mdl"
ITEM.width = 1
ITEM.height = 1
ITEM.physDesc = "Simple desc"
ITEM.desc = "The best Chevrolet car"
ITEM.maxGas = 50
ITEM.maxGas = 1000
ITEM.price = 35000
ITEM.vehicleData = {
type = TYPE_GENERIC,
model = ITEM.model,
script = "scripts/vehicles/lwcars/chev_impala_09.txt",
name = ITEM.name,
physDesc = ITEM.physDesc,
maxGas = ITEM.maxGas,
seats = {
{
pos = Vector(14.188320159912, 8.272798538208, 1.2972664833069),
ang = Angle(0, 0, 0),
}
}
}

Btw, spawned car does have Name and desc, but in inventory it only prints models/lonewolfie/chev_impala_09_police.mdl

Chessnut commented 9 years ago

You need an ITEM.desc

Trixas commented 9 years ago

You need an ITEM.desc But I do have it?

ITEM.name = "Chevrolet Impala"
ITEM.model = "models/lonewolfie/chev_impala_09_police.mdl"
ITEM.width = 1
ITEM.height = 1
ITEM.physDesc = "Simple desc"
ITEM.desc = "The best Chevrolet car"

Last row

Chessnut commented 9 years ago

Try changing ITEM.price to ITEM.cost On Sun, May 17, 2015 at 08:58 Trixas notifications@github.com wrote:

You need an ITEM.desc But I do have it?

ITEM.name = "Chevrolet Impala" ITEM.model = "models/lonewolfie/chev_impala_09_police.mdl" ITEM.width = 1 ITEM.height = 1 ITEM.physDesc = "Simple desc" ITEM.desc = "The best Chevrolet car"

Last row

— Reply to this email directly or view it on GitHub https://github.com/Chessnut/NutScript/issues/479#issuecomment-102817329.