addEventHandler( "onPlayerQuit", getRootElement( ),
function( )
local acc = getPlayerAccount( source )
if acc and not isGuestAccount( acc ) then
local x, y, z = getElementPosition( source )
setAccountData( acc, "pos", toJSON( { x = x, y = y, z = z } ) )
end
showLogin( source )
end
)
El evento onPlayerQuit no tiene el parámetro account.
string quitType, string reason, element responsibleElement
También hay un error en getAccountData().
local lastPos = fromJSON(getAccountData( player, "pos" )) -- ahí pusiste al player en vez de la cuenta (acc).