I have a problem with my inventory when I do "use"


Hi, I have a small problem with my function use of my inventory, I have created a system so that when I use face its realizes a function according to the canUse except that it realizes me the same function for all the items .

My function use :

function use(val)
    local itemId = val[1]
    local canUse = val[2]
    if canUse ~= 0 then
        if canUse ~= 1 then
        elseif canUse ~= 2 then
        TriggerEvent('player:looseItemS', itemId, 1)
        Chat("Cet objet ne fait rien")

Then after I created normal functions like eat or other

Do you have an idea ?


I’m having issues understanding what the issue is :confused:
Could you like rephrase it?

I have created a system so that when I use face
When you use your face? what


Sorry, breaking if you want, my canUse are the same they do the same function and I want it to face a different function, yet in my code it has marked that it is not the same function


Sorry dude, my brain is turning to a crisp when trying to comprehend your issue. But good luck, maybe someone else can decipher this :confused:


i see that you have a bit trouble to make you understand ^^ fair enough.

maybe (if the admin don’t mind) you can explain it in french and i will translate it best as i can.