There's no point on looping the table, it can be done like this:
local ranks =
{
1000,
900,
800,
700,
600,
500,
400,
300,
200,
100
}
addEventHandler ( "onPlayerWasted", root,
function ( )
local reward = ranks [ exports [ "race" ]:getPlayerRank ( source ) ]
if ( reward ) then
givePlayerMoney ( source, reward )
end
end
)