Advertisement
wassimevicw

DropBox

Jun 8th, 2017
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.30 KB | None | 0 0
  1. tfm.exec.disableAllShamanSkills (true)
  2. tfm.exec.disableAutoShaman (true)
  3. tfm.exec.disableAutoNewGame(true)
  4. countdown = 10
  5. maps = {7154043, 7154390, 7154714, 7167039, 7167039, 7167061, 7167891, 7167068, 7167926, 7167940, 7167934, 7167952, 7167956, 7167960 ,7167964, 7167971 ,7167973}  
  6. players = {}
  7. data={}
  8.  
  9.  
  10. function PlayerMaxScore(ttype)
  11. if ttype=="NamePlayerMaxScore" or "ScorePlayerMaxScore" then
  12. maxScore=0
  13. score={}
  14. name=""
  15. local x=0
  16. for n,p in pairs(tfm.get.room.playerList) do table.insert(score,p.score); end
  17. for n,p in pairs(score) do x=x+1
  18. if score[x] >= maxScore then maxScore = score[x] end
  19. end
  20. for n,p in pairs(tfm.get.room.playerList) do if p.score == maxScore then name = n
  21. end
  22. end
  23. if ttype=="NamePlayerMaxScore" then
  24. return name
  25. elseif ttype=="ScorePlayerMaxScore" then
  26. return maxScore
  27. end -- end ttype
  28. end -- end ttype
  29. end -- end function
  30.  
  31. function eventNewPlayer(n)
  32.     data[n]={Stime=os.time(),name=n}
  33.     tfm.exec.chatMessage("<vp>DropBox <j>أهلاً بكم في نمط<br><br><rose>!!! حاول الهرب من الشامان الذي يضع الصناديق",n)
  34. end
  35.  
  36. for n,p in pairs(tfm.get.room.playerList) do
  37. eventNewPlayer(n)
  38. end
  39.  
  40.  
  41. function eventNewGame()
  42.   shaman = PlayerMaxScore("NamePlayerMaxScore")
  43.   countdown = 10
  44.   started = false
  45.   tfm.exec.setUIMapName("<J>"..countdown.."...\n")
  46.   tfm.exec.setUIShamanName(shaman)
  47.   tfm.exec.killPlayer (shaman)
  48. tfm.exec.setNameColor(shaman, 0x00FFDB)
  49. system.bindMouse(shaman, true)
  50. end
  51.  
  52.  
  53. function eventMouse(name, x, y)
  54.     local ia=math.random(1,14)
  55.     local ib=math.random(21,44)
  56.     local ii=math.random(ia,ib)
  57. if data[name].Stime < os.time()-3000 and name == shaman then
  58. tfm.exec.addShamanObject(tfm.enum.shamanObject.littleBox, x, y, 0, 0, 0, false)
  59. local r = 30
  60. for i = 1, 360 do
  61.   local angle = i * math.pi / 180
  62.   local ptx, pty = x + r * math.cos( angle ), y + r * math.sin( angle )
  63. tfm.exec.displayParticle (ii, ptx, pty, 0, 0, 0, 0, nil )
  64. end
  65.  
  66.  
  67. data[name].Stime=os.time()
  68. end
  69. end
  70.  
  71.  
  72.  
  73. function eventLoop()
  74.     started = true
  75.   countdown = countdown - 1
  76.   tfm.exec.setUIMapName("<J>"..countdown.."...\n")
  77.   if countdown <= 0 then
  78.     tfm.exec.setUIMapName("انطلاق")
  79.     tfm.exec.chatMessage("<rose>!! انت الشامان الان<br>حاول منع الفأران من الدخول بأستخدام الفأرة",shaman)
  80.   end
  81. end
  82.  
  83. function eventPlayerDied(name)
  84.     local i=0
  85.     local n
  86.     for pname,player in pairs(tfm.get.room.playerList) do
  87.         if not player.isDead then
  88.             i=i+1
  89.             n=pname
  90.         end
  91.     end
  92.     if i==0 then
  93.         nextRound()
  94.     end
  95. end
  96.  
  97. function eventPlayerWon(name,tE,tER)
  98.     local i=0
  99.     local n
  100.     for pname,player in pairs(tfm.get.room.playerList) do
  101.         if not player.isDead then
  102.             i=i+1
  103.             n=pname
  104.         end
  105.     end
  106.     if i==0 then
  107.         nextRound()
  108.     end
  109. end
  110.    
  111.  
  112. function nextRound()
  113.     tfm.exec.setPlayerScore (shaman,0)
  114.     tfm.exec.newGame(maps[math.random(#maps)]);
  115. end
  116.     for n in pairs(tfm.get.room.playerList)do
  117.         if n ~= shaman then
  118.         tfm.exec.setNameColor(n,0x00FFDB)
  119.         end
  120.     end
  121. tfm.exec.newGame(maps[math.random(#maps)])
  122. tfm.exec.setNameColor("Turkitutu",0x00ff00)
  123. tfm.exec.setNameColor("wassimevicw",0x00ff00)
  124. tfm.exec.setNameColor("unlocker001",0x00ff00)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement