Guest User

Untitled

a guest
Dec 9th, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.78 KB | None | 0 0
  1. function getTopFiveKillers()
  2.     killer1 = nil
  3.     killer2 = nil
  4.     killer3 = nil
  5.     killer4 = nil
  6.     killer5 = nil
  7.     local allplayerlist = getElementsByType ( "player" )
  8.  
  9.     local killstobeat = -1000
  10.     for theKey,thePlayer in ipairs(allplayerlist) do
  11.         if thePlayer ~= killer1 and thePlayer ~= killer2 and thePlayer ~= killer3 and thePlayer ~= killer4 and thePlayer ~= killer5 then
  12.         local killcount = getElementData(thePlayer, "kills")
  13.         if killcount > killstobeat then
  14.             killer1 = thePlayer
  15.             killstobeat = killcount
  16.         end
  17.     end
  18.  
  19.     local killstobeat = -1000
  20.     for theKey,thePlayer in ipairs(allplayerlist) do
  21.         if thePlayer ~= killer1 then
  22.         local killcount = getElementData(thePlayer, "kills")
  23.         if killcount > killstobeat then
  24.             killer2 = thePlayer
  25.             killstobeat = killcount
  26.         end
  27.     end
  28.  
  29.     local killstobeat = -1000
  30.     for theKey,thePlayer in ipairs(allplayerlist) do
  31.         if thePlayer ~= killer1 and thePlayer ~= killer2 then
  32.         local killcount = getElementData(thePlayer, "kills")
  33.         if killcount > killstobeat then
  34.             killer3 = thePlayer
  35.             killstobeat = killcount
  36.         end
  37.     end
  38.  
  39.     local killstobeat = -1000
  40.     for theKey,thePlayer in ipairs(allplayerlist) do
  41.         if thePlayer ~= killer1 and thePlayer ~= killer2 and thePlayer ~= killer3 then
  42.         local killcount = getElementData(thePlayer, "kills")
  43.         if killcount > killstobeat then
  44.             killer4 = thePlayer
  45.             killstobeat = killcount
  46.         end
  47.     end
  48.  
  49.     local killstobeat = -1000
  50.     for theKey,thePlayer in ipairs(allplayerlist) do
  51.         if thePlayer ~= killer1 and thePlayer ~= killer2 and thePlayer ~= killer3 and thePlayer ~= killer4 then
  52.         local killcount = getElementData(thePlayer, "kills")
  53.         if killcount > killstobeat then
  54.             killer5 = thePlayer
  55.             killstobeat = killcount
  56.         end
  57.     end
  58.     return killer1, killer2, killer3, killer4, killer5
  59. end
Add Comment
Please, Sign In to add comment