0

So I am getting the error

[script:tb_fuel] SCRIPT ERROR: @tb_fuel/config.lua:117: attempt to index a nil value (global 'ESX') [script:tb_fuel] > getplayer (@tb_fuel/config.lua:117)`,

I have no idea what is causing this and how to fix it.

Code from line 117:

function getplayer(source)
    xPlayer = ESX.GetPlayerFromId
    return xPlayer
end
Nifim
  • 4,758
  • 2
  • 12
  • 31
EthanP
  • 1
  • 4
  • 2
    The global variable `ESX` is *nil*. Either whatever is responsible for setting the variable has not done so (automatically by the host environment, or via [`require`](https://www.lua.org/manual/5.4/manual.html#pdf-require)), or the variable has been mistakenly set to *nil* somewhere. Where did you get this script, and are you sure it is correct for your environment? (Guesswork: are you sure you are using the [ESX](https://github.com/esx-framework) framework?) – Oka Jul 25 '23 at 20:53

0 Answers0