Es_extended useItem bug

For some reason after using an item like food. The animation, status, and everything updates and works perfectly fine. However if I jump or hit, or perform some certain kind of triggering actions, the item will be used again. So if I’m eating a burger, and then press Spacebar, another burger from my inventory will be used, therefore being removed and counting as if I used another burger (Like if the eventhandler was triggered again)…

I discovered this while testing a script I was making so players could consume drugs in my server. During or after the animation of smoking weed if someone performs an action (I confirmed SpaceBar, or hit button will trigger this. A couple more would also do, but I didn’t take the time to test for each single button.) it will re use the item. This happens with all my consumable items so I’m guessing it has to be with useItem function.

This might be because your inventory menu stays open while you’re consuming the item? If so then add a menu.close() at the end of each action on your client.lua

It is probably that. Thanks for the advice. I will check it as soon as I get the time.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.