function onPlayerQuit ( )
local playeraccount = getPlayerAccount ( source ) -- source instead of Acc
if ( playeraccount ) and not isGuestAccount ( playeraccount ) then
local playerskin = getElementModel ( source ) -- source instead of Acc
setAccountData ( playeraccount, "player.skin", playerskin )
end
end
function onPlayerLogin (_, playeraccount )
if ( playeraccount ) then
local playerskin = getAccountData ( playeraccount, "player.skin" )
if ( playerskin ) then
setElementModel ( source, playerskin ) -- source instead of Acc
end
end
end
addEventHandler ( "onPlayerQuit", getRootElement ( ), onPlayerQuit )
addEventHandler ( "onPlayerLogin", getRootElement ( ), onPlayerLogin )