Creating Items
All of the items are defined in the items.lua file with key, value pairs. Key is the name (not the label) of an item and the value is a table containing the options for the item.
You can edits items in the tgiann-inventory/items folder
Many features work exactly the same as in ox_inventory, the most popular free inventory system.
Item Options
label:
string|Record<string, string>weight:
inttype:
item|weaponimage?:
string(docs)shouldClose?:
boolendescription:
string|Record<string, string>server?:
tableexport?:
string
consume?:
numberItem count needed and removed use.
client?:
tableexport?:
string(Export to be triggered after item use)event?:
string(Client event to be triggered after item use)status?:
table(Adjust esx_status/qb values after use)anim?:
table(Animation that will be played during the progress bar)dict:
stringclip:
string
prop?:
table(Attached prop that will be displayed during the progress bar)model:
stringorhashpos:
table(x, y, z)rot:
table(x, y, z)bone?:
numberrotOrder?:
number
disable?:
table(Actions to be disabled during the progress bar)move?:
booleancar?:
booleancombat?:
booleanmouse?:
boolean
usetime?:
number(Progress bar duration)cancel?:
boolean(If set to true the player canc cancel item use)notification?:
string(Notification to be sent when the item is used)add?:
function(total:number)Function that triggers when receiving an item
Returns total item count as
total
remove?:
function(total:number)Function that triggers when removing an item
Returns total item count as
total
buttons?:
tablelabel:
stringaction:
function(slot:number)Callback function when button is clicked in context menu, returns item slot.
testburger = {
label = 'Test Burger',
weight = 220,
type = "item",
image = "testburger.png",
unique = false,
useable = true,
shouldClose = false,
description = "It's a Burger"
client = {
image = 'burger_chicken.png',
status = { hunger = 200000, thirst = 10000 },
anim = { dict = 'missheistdockssetup1clipboard@idle_a', clip = 'idle_a', flag = 49 },
prop = { model = `prop_rolled_sock_02`, pos = vec3(-0.14, -0.14, -0.08), rot = vec3(-50.0, -50.0, 0.0) },
usetime = 2500,
notification = 'You used the burger'
event = "tgiann-food-job:useBurger",
export = 'tgiann-food-job.testburger' -- Script Name . Function name
},
server = {
export = 'tgiann-food-job.testburger', -- Script Name . Function name
},
}Exmaple Mutli language labels
test_item = {
label = {
tr = 'Örnek Çok Dilli Etiket',
en = 'Example Multi Language Label',
},
weight = 100,
type = 'item',
description = {
tr = 'Bu bir örnek çok dilli etiket içeren bir öğedir.',
en = 'This is an item with an example multi language label.',
},
buttons = {
{
label = {
tr = 'Özel Buton',
en = 'Custom Button',
},
action = function(slot)
print('Custom Button', slot)
end
}
},
},more examples are in the items/items.lua file
Last updated