player.get_scoreboard_pos

This function returns a player's position on the scoreboard. A value of 1 represents 1st place, while a value of 0 results if the function is called on no_player.

This function returns number. Calling this function without storing its return value in a variable is an error.

Example

alias leader_traits = script_traits[0]

for each player do
   global.number[0] = current_player.get_scoreboard_pos()
   if global.number[0] == 1 then
      current_player.apply_traits(leader_traits)
   end
end

See also