Safwanrockz

Untitled

Dec 21st, 2013
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.38 KB | None | 0 0
  1. function firstPlayer()
  2.          local player1
  3.      local scores={}
  4.      for i,score in pairs(tfm.get.room.playerList) do
  5.          table.insert(scores, tfm.get.room.playerList[i].score)
  6.      end
  7.      table.sort(scores)
  8.      for name,player in pairs(tfm.get.room.playerList) do
  9.          if tfm.get.room.playerList[name].score == scores[#scores] then
  10.              player1=name
  11.          end
  12.      end
  13.      return player1
  14. end
Advertisement
Add Comment
Please, Sign In to add comment