Advertisement
Guest User

Untitled

a guest
Dec 5th, 2016
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.79 KB | None | 0 0
  1. local players = {}
  2. local hited = {}
  3.  
  4. function _getPlayers(range)
  5. for _, c in Creature.iPlayers(range) do
  6. name = c:Name()
  7. return true
  8. end
  9. return false
  10. end
  11.  
  12. function _insertPlayers()
  13. for _, c in Creature.iPlayers(range) do
  14. if not _tableContains(players, c:Name()) then
  15. players[#players + 1] = c:Name()
  16. print('Added to list '..c:Name())
  17. end
  18. end
  19. end
  20.  
  21. function _tableContains(table, nick)
  22. for i = 1, #table do
  23. if table[i] == nick then
  24. setName = table[i]
  25. return true
  26. end
  27. end
  28. return false
  29. end
  30.  
  31. function _checkLifeStatus(hpperc)
  32. if _tableContains(hited, setName) then
  33. local player = Creature.New(setName)
  34. local self = Creature.GetByID(Self.ID())
  35. if player:isOnScreen() and player:HealthPercent() <= hpperc then
  36. if self:Skull() == 3 then
  37. print('I killed him omg, exiting..')
  38. wait(2000)
  39. os.exit()
  40. end
  41. end
  42. end
  43. end
  44.  
  45. BattleMessageProxy.OnReceive('server', function(proxy, text)
  46. if _getPlayers(7) then
  47. if _tableContains(players, name) then
  48. dmg = text:match('%d')
  49. if text:find(setName) and text:find('your attack.') then
  50. if not _tableContains(hited, setName) then
  51. hited[#hited + 1] = setName
  52. print('You hit '.. setName ..' for '.. dmg ..'.')
  53. else
  54. if setName ~= nil then
  55. print('You hit '.. setName ..' for '.. dmg ..'.')
  56. end
  57. end
  58. end
  59. end
  60. end
  61. end)
  62.  
  63. Module.New('Anti-Rs', function()
  64. _insertPlayers()
  65. _checkLifeStatus(0)
  66. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement