Install
These are the instructions for installing the Click To Use script
Step 1: Locate your [ks-ctu] folder
[ks-ctu] folderGo to the
resourcesfolder in your FiveM server directory.Ensure the folder name is exactly
[killstore](including the square brackets).Locate the folder
[ks-ctu]inside.If it is not there, please go back to the Welcome! page and make sure to have all your files together.
Step 2: Ensure the Script
Open the
server.cfgfile located in your FiveM server's main directory.Add ensure
Ks_Click_To_Use-AssetsBEFORE your Framework:
ensure Ks_Click_To_Use-Assets
ensure Your_frameworkAdd the following line AFTER your inventory system:
ensure Your_Inventory
ensure [killstore]It should finally look like this
# ...
ensure Ks_Click_To_Use-Assets
ensure Your_framework
# ...
ensure Your_Inventory
ensure [killstore]Now you need to restart the server.
Step 3: install the AUTO-ITEMS
Inside the [ks_ctu] folder, you will find an installation folder:
Ks_Click_To_Use-Assets/ICON:
Copy the item icons from the images folder into your inventory’s image directory.
Auto-Items
Installation of items is not necessary as they will be automatically installed with the following, please be careful depending on your frame/inventory combination
qb-core
If you are using QB-Core with:
Quasar Inventory (qs-Inventory)
Origen Inventory (origen_Inventory)
Ox Inventory (ox_Inventory)
or the items must be placed within QB-Core
Select one of the following tabs depending on your inventory
go to the path
qs-inventory\shared\items.luaAt the END of the code for your item list, put the following:
local killstoreItems = exports['Ks_Click_To_Use-Assets']:killstoreItems()
for itemName, itemData in pairs(killstoreItems) do
QBShared.Items[itemName] = itemData
endgo to the path
origen_inventory\config\items.luaAt the END of the code for your item list, put the following:
local killstoreItems = exports['Ks_Click_To_Use-Assets']:killstoreItems()
for itemName, itemData in pairs(killstoreItems) do
OrgItems[itemName] = itemData
endgo to the path
ox_inventory\modules\items\shared.luaBefore the line that says "
return ItemList" put the following
-- (Other code)
----------------------------
local ksItems = {}
local killstoreItems = exports['Ks_Click_To_Use-Assets']:killstoreItems()
for Ksname, Ksdata in pairs(killstoreItems) do
if not ksItems[Ksdata.name] then
ksItems[Ksdata.name] = {
name = Ksdata.name,
label = Ksdata.label,
weight = tonumber(Ksdata.weight) or 100,
stack = Ksdata.unique and false or true,
close = Ksdata.shouldClose and false or true
}
end
end
for k, v in pairs(ksItems) do
local success, response = pcall(newItem, v)
if not success then
warn(('An error occurred while creating killsotre item "%s" callback!\n^1SCRIPT ERROR: %s^0'):format(k, response))
end
end
--------------
return ItemList -- <- Search it and only have this at the very lastesx
If you are using ESX with:
Quasar Inventory (qs-Inventory)
Origen Inventory (origen_Inventory)
Ox Inventory (ox_Inventory)
or the items must be placed within YOUR INVENTORY
Select one of the following tabs depending on your inventory
go to the path
qb-core\shared\items.luaAt the END of the code for your item list, put the following:
local killstoreItems = exports['Ks_Click_To_Use-Assets']:killstoreItems()
for itemName, itemData in pairs(killstoreItems) do
ItemList[itemName] = itemData
endgo to the path
qb-core\shared\items.luaAt the END of the code for your item list, put the following:
local killstoreItems = exports['Ks_Click_To_Use-Assets']:killstoreItems()
for itemName, itemData in pairs(killstoreItems) do
OrgItems[itemName] = itemData
endgo to the path
ox_inventory\modules\items\shared.luaBefore the line that says "
return ItemList" put the following
-- (Other code)
----------------------------
local ksItems = {}
local killstoreItems = exports['Ks_Click_To_Use-Assets']:killstoreItems()
for Ksname, Ksdata in pairs(killstoreItems) do
if not ksItems[Ksdata.name] then
ksItems[Ksdata.name] = {
name = Ksdata.name,
label = Ksdata.label,
weight = tonumber(Ksdata.weight) or 100,
stack = Ksdata.unique and false or true,
close = Ksdata.shouldClose and false or true
}
end
end
for k, v in pairs(ksItems) do
local success, response = pcall(newItem, v)
if not success then
warn(('An error occurred while creating killsotre item "%s" callback!\n^1SCRIPT ERROR: %s^0'):format(k, response))
end
end
--------------
return ItemList -- <- Search it and only have this at the very lastothers
If you are using another framework or another inventory you can adapt it yourself, you should know that the export killstoreItems() contains the list of all the items of the click to use modules, and they are placed in a table
--@ killstoreItems -- table
local killstoreItems = exports['Ks_Click_To_Use']:killstoreItems()
print(json.encode(killstoreItems , {indent = true}))
-- killstoreItems result :
"millk-r": {
"label": "Mochila Leche Roja",
"name": "millk-r",
"weight": 100,
"image": "millk-r.png",
"unique": false,
"type": "item",
"combinable": true,
"shouldClose": false,
"useable": true
},
"millk-be": {
"label": "Mochila Leche Beige",
"name": "millk-be",
"weight": 100,
"image": "millk-be.png",
"unique": false,
"type": "item",
"combinable": true,
"shouldClose": false,
"useable": true
},
....
Last updated