Fivem Cancarryitem error

I added a esx_illegal_drugs script to my server, and Whenever I try harvest drugs like weed,opium,meth,coke i get this error
'Attempt to call a nil value (field ‘cancarryitem’)

Could anyone help ive tried everything?

Hi!
Can you send a screenshot of cancarryitem in your lua file?

You’re mixing eras of ESX resources and core ESX. cancarryitem is how later ESX > 1.1 handles weight-based inventory. Before that, ESX used a numerical limit-based inventory.

You have three solutions:

  1. Change your version of ESX version to work with your resource looking for weight-based.
  2. update your resource to work with your version of ESX.
  3. Modify your resource to work with your version of ESX.

i would need help with that because i dont wanna mess my server up

It’s pretty hard to help you without having you provide links to the code you’re using. What version of ESX are you running? Can you link the drug script you’re using? It may be as simple as using an older release of the drugs resource you’re using.

What version of ESX are you running?

i think 1 or the old one and that is the problem im pretty sure i need to update esx but how do i do that without messing up my server files?

It’s not a case of dropping in a completely different esx resource. You would need to implement the newer version then start tracking down errors in resources that aren’t designed to work with it. Depending on what you’re running, this process can range from trivial to maddening.

1 Like

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