Getting nil to xplayer.source when spawning a car to give keys using cd_garage

Hello, any help would be appreciated;
Im using es_extended legacy 1.9.0 and esx_vehicleshop

My issue is that when i add a trigger from the cd_garage script to give keys some errors are shown in the console and no keys are given, i also don’t tp to the vehicle bought, just spawns in back of vehicle shop.

here i attach some screenshots of the code debugged (xplayer.source is returning nil; seems that can’t locate me in order to tp me to car and give me keys)
Pic of code debugged and triggerclientEvent(‘cd_garage:AddKeys’… on onseync.lua from es_extended/server

I’ve also tried adding it here below line 166 of esx_vehicleshop/main.lua and no errors shown but no keys given…

Spent last 3 days with codesign support to see if it was their script but they claim is not they fault i should ask esx… any help? Thanks
Here i attach screenshot of console w debugged code:

Hi :wave: @Fran_Luque

:thinking:
In the first picture, line 69 xplayer has not been defined yet, which is why it is giving an error.

1 Like

Lol, thanks a lot