Console Error Code With UI Inventory

Hello,
So I’ve been messing around making a server and I went with an esx framework. I am running into some issues with some code. I recently added this resource:

It works for the most part but when I load into the game my console spams this error code over and over again until I log:


I will also provide the code in question. I just don’t know enough about lua to figure out what is going on here:

Line 30 seems to be the start of the issues “local xPlayer” being set to “ESX.GetPlayerFromId”
If anyone can offer some guidance as to what is going on here I will be eternally grateful.

Thank you for your time.