π₯οΈBasics, Configurations, Exports & Events
Phone has exports, events, you can find all these from this list
Basics
Item Creation
Item creation is basic, just locate configs/config_items.lua open file after that,
['example_item'] = { -- Item code to give
['name'] = 'example_item', -- Item code to give
['label'] = 'Our Example Item', -- Item display name
['weight'] = 100, -- Item weight calculated in grams because QB
['type'] = 'item', -- Item type is unneccesary, its affects only weapons.
['image'] = 'example_item_image.png', -- Item image, needs to be located at "web/images/xxx.png"
['unique'] = true, -- This means your items cannot be merged each other
['useable'] = true, -- This means your item can be useable
['shouldClose'] = true, -- This means usage will close your inventory UI
['combinable'] = nil, -- Unneccesary
['description'] = 'Our best example item!' -- Item tooltip description
},Item Converter
If you have customized values, locate server/items-convert.lua, and customize to your server.
Start your server, enter the "convertitems" to your server console. It will create config_converted.lua named file, you can transfer all items to configs/config_items.lua
Exports & Events
Server Side Exports
UseItem - Its made for item useage.
SetMainItems - Sets ls-core items data
LoadInventory - Loads player inventory.
SaveInventory - Saves player inventory.
GetTotalWeight - Gets items total weight.
GetSlotsByItem - Gets slots by itemname.
GetFirstSlotByItem - Gets first slot by itemname.
AddItem - Adds an item to player inventory.
RemoveItem - Removes an item to player inventory.
GetItemBySlot - Gets items from slot.
GetItemByName - Gets items from name.
GetItemsByName - Gets items from slot.
ClearInventory - Clears player inventory.
SetInventory - Sets player inventory.
SetItemData - Sets player item data.
HasItem - Checks player has item.
Client Side Exports
CloseInventory - Closes player inventory.
RobPerson - Opens second player inventory.
SetInventoryClothings - Sets player inventory clothings.
Client Side Events
inventory:c:giveClothesAsItem - Gives player clothings to as item.
Some clothing system uses different types, for that reason if you dont know how to enter oldSkin only use like,
Server Side Events
inventory:server:openInventory - Opens player inventory.
inventoryType mostly requires "stash". otherStuff is an unneccesary stuff, you can only enter { maxweight = weight, slots = slot}.
inventoryId needs to be unique.
Last updated
