Hi all,
I’m having a lot of trouble trying to figure out why the new items I’ve added to my server are not being registered and not working.
I have copy & pasted the big mac item in my server as reference, here is the code for it AND THIS WORKS IN MY SERVER:
ESX.RegisterUsableItem(‘bigmac’, function(source)
local xPlayer = ESX.GetPlayerFromId(source)
xPlayer.removeInventoryItem(‘bigmac’, 1)
TriggerClientEvent('esx_status:add', source, 'hunger', 350000)
TriggerClientEvent('esx_status:add', source, 'thirst', 70000)
TriggerClientEvent('esx_basicneeds:onEat', source)
TriggerClientEvent('esx:showNotification', source, _U('used_bigmac'))
end)
Yet…when I try to create my new item chow mein as registered usable it is not working, this is what I’ve done:
ESX.RegisterUsableItem(‘chowmein’, function(source)
local xPlayer = ESX.GetPlayerFromId(source)
xPlayer.removeInventoryItem(‘chowmein’, 1)
TriggerClientEvent('esx_status:add', source, 'hunger', 350000)
TriggerClientEvent('esx_status:add', source, 'thirst', 70000)
TriggerClientEvent('esx_basicneeds:onEat', source)
TriggerClientEvent('esx:showNotification', source, _U('used_chowmein'))
end)
I have put the notification in my en.lua for used_chowmein and have the picture, and made it an item in my oxesx items…but it is still not working. Pops up in my inventory and everything just not able to use it.