Just wondering if anyone know why I’m getting this error and how to fix?
SCRIPT ERROR in reference call: System.InvalidCastException: Could not cast event argument from ExpandoObject to ExtendedPlayer
This is what my C# code looks like and I’m calling the AddXPlayer method:
On the Lua side…
This is where a stripped down version of xPlayer from ESX gets created:

And this is where I create the stripped down one from the main ESX xPlayer to be passed to the C# export:
local xPlayer = CreateExtendedPlayer(playerId, identifier, userData.group, userData.accounts, userData.inventory, userData.weight, userData.job, userData.loadout, userData.playerName, userData.coords)
local xPlayerNet = CreateExtendedPlayerNet(xPlayer)
exports.es_extended:AddXPlayer(playerId, identifier, xPlayerNet)
Why does it say there’s an “event” that can’t be cast given there’s only a string on the object being converted?
