please look this code
addEventHandler("onElementDataChange",_root,
function (theName,theOldValue)
if (theName == "race.finish") then --and (getElementType (source) == "player") then
-- if not (isGuestAccount (getPlayerAccount (source))) then
local playerAccount = getPlayerAccount(source)
local playerMoney = getAccountData(playerAccount,"VIPM-Money")
if (playerMoney) and (playerAccount) then
if (getElementData (source,"race rank") == 1) then
local playerCount = getPlayerCount ()
local winningMoney = playerCount *50
local allMoney = playerMoney + winningMoney
outputChatBox("#aa00ff<Script>:#ffffff " .. getPlayerName(source) .. " won " .. tostring (winningMoney) .. "$ for 1st!!",_root,255,255,255,true)
setAccountData (playerAccount, "VIPM-Money", allMoney)
end
end
-- else
-- ouptutChatBox ("#aa00ff<Script>:#ffffff " .. getPlayerName(source) .. " won NOTHING because he is not logged in.")
-- end
end
end)