Hello , am i doing it correctly? still unable to use the item…
CreateUsableItem.lua
TriggerEvent('clothesitems:swatoutfit')
TriggerEvent('clothesitems:swathelmet')
TriggerEvent('clothesitems:swatvest')
CreateUsableItem('swatoutfit', function(source, item)
local source = source
local xPlayer = ESX.GetPlayerFromId(source)
xPlayer.removeInventoryItem("swatoutfit", 1)
TriggerClientEvent('clothesitems:swatoutfit', source, item, 'swatoutfit')
end)
CreateUsableItem('swathelmet', function(source, item)
local source = source
local xPlayer = ESX.GetPlayerFromId(source)
xPlayer.removeInventoryItem("swathelmet", 1)
TriggerClientEvent('clothesitems:swathelmet', source, item, 'swathelmet')
end)
CreateUsableItem('swatvest', function(source, item)
local source = source
local xPlayer = ESX.GetPlayerFromId(source)
xPlayer.removeInventoryItem("swatvest", 1)
TriggerClientEvent('clothesitems:swatvest', source, item, 'swatvest')
end)
items.lua
-- kurlie_clothing_item
['swatoutfit'] = {
label = 'Clothing',
weight = 5,
stack = false,
consume = 0,
},
['swathelmet'] = {
label = 'Clothing',
weight = 50,
stack = false,
consume = 0,
},
['swatvest'] = {
label = 'Clothing',
weight = 50,
stack = false,
consume = 0,
},
config.lua
Config = {
Ring1 = {
Male = { chain_1 = 7, chain_2 = 0 },
Female = { decals_1 = 52, decals_2 = 1 }
},
Necklace = {
Male = { chain_1 = 129, chain_2 = 4 },
Female = { chain_1 = 4, chain_2 = 4 }
},
NeckBrace = {
Male = { chain_1 = 208, chain_2 = 0 },
Female = { chain_1 = 180, chain_2 = 0 }
},
swatoutfit = {
Male = { tshirt_1 = 16, tshirt_2 = 0, torso_1 = 74, torso_2 = 0, arms = 0, pants_1 = 126, pants_2 = 0, shoes_1 = 21, shoes_2 = 0 },
Female = { tshirt_1 = 14, tshirt_2 = 0, torso_1 = 720, torso_2 = 0, arms = 4, pants_1 = 17, pants_2 = 0, shoes_1 = 5, shoes_2 = 2 }
},
swathelmet = {
Male = { helmet_1 = 57, helmet_2 = 0 },
Female = { tshirt_1 = 275, tshirt_2 = 0 }
},
swatvest = {
Male = { bproof_1 = 11, bproof_2 = 0 },
Female = { bproof_1 = 63, bproof_2 = 0 }
}
-- These are examples. Please make sure to edit these and add more that you want
}