How do i make this script a usable item

hey ! i have this vape script and i want to make it a usable item that you can buy and use the script is working by a command
my framework is QBUS

script:
CL-Vape.zip (3.4 KB)

thx

You basically need to delete the command, add the item to the item table (I assume it is called “items”) on your server. After doing it you have to create a MYSQL Query that looks like that:

local player = GetPlayerIdentifiers(source)[1]
local hasItem = MySQL.Sync.fetchScalar("SELECT item FROM <whatever the name of the table with the player inventory is> WHERE identifier = @username AND itemToCheck = itemToCheck,{['@username'] = identifier})

Add this item to esx_basicneeds by registering an usable item and add code to it. I assume you will have to trigger some kind of client events or/and server events from the vape script

1 Like