I try to make onPlayerWasted that you lost the cash,
but i dont get it, any can help me?
theRoot = getRootElement ()
theResRoot = getResourceRootElement ( getThisResource () )
addEventHandler("onPlayerWasted", theRoot,
function ( attacker, player )
local money = getPlayerMoney(player)
if ( attacker ) then
if ( getElementType ( attacker ) == "player" ) then
takePlayerMoney ( player, money )
setPlayerMoney( attacker, money )
end
end
end
)
what i do wrong!!??