Advertisement
Dudugz-Contistente

Untitled

Nov 12th, 2016
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.74 KB | None | 0 0
  1. admin=""
  2. mapas = {6930458}
  3. p = {}
  4.  
  5. tfm.exec.disableAutoNewGame(true)
  6. tfm.exec.disableAutoShaman(true)
  7. tfm.exec.disableAutoTimeLeft(true)
  8. tfm.exec.disableAfkDeath(true)
  9.  
  10. function eventNewPlayer(name)
  11. p[name]={
  12. click = true,
  13. time_click = 0,
  14. }
  15.  
  16. tfm.exec.setPlayerScore(name,0,false)
  17. system.bindMouse(name,true)
  18. end
  19.  
  20. for all in pairs(tfm.get.room.playerList) do
  21. eventNewPlayer(all)
  22. end
  23.  
  24. function eventMouse(name,x,y)
  25. if p[name].click and admin == name then
  26. tfm.exec.explosion (x, y, 20, 100, true)
  27. tfm.exec.displayParticle(12,x,t)
  28. p[name].click = false
  29. p[name].time_click = 6
  30. end
  31. end
  32.  
  33. function eventLoop()
  34. if not p[admin].click then
  35. if p[admin].time_click > 0 then
  36. ui.addTextArea(0,"<b><p align='center'><VP><font size='15'>"..math.floor(p[admin].time_click/2).."</font></p>",nil,5,370,790,25,nil,nil,80,true)
  37. p[admin].time_click = p[admin].time_click-1;
  38. else
  39. p[admin].click = true
  40. ui.removeTextArea(0,nil)
  41. end
  42. end
  43. end
  44.  
  45. function eventPlayerDied(name)
  46. tfm.exec.setPlayerScore(name,2,true)
  47. if vivos > 1 then
  48. vivos = vivos-1;
  49. else
  50. for i in pairs(tfm.get.room.playerList) do
  51. if not tfm.get.room.playerList[i].isDead then
  52. tfm.exec.giveCheese(I)
  53. tfm.exec.playerVictory(i)
  54. end
  55. end
  56.  
  57. tfm.exec.newGame(mapas[math.random(#mapas)])
  58. end
  59. end
  60.  
  61. function eventNewGame()
  62. vivos = 0
  63.  
  64. local sc = {}
  65. for name,player in pairs(tfm.get.room.playerList) do
  66. vivos=vivos+1;
  67. sc[#sc+1] = {n=name,s=player.score}
  68. end
  69. table.sort(sc,function(a,b) return a.s>b.s end)
  70.  
  71. for k,v in pairs(sc) do
  72. if k < 2 then
  73. admin = v.n
  74. end
  75. end
  76.  
  77. tfm.exec.killPlayer(admin)
  78. end
  79.  
  80. tfm.exec.setUIMapName("Power of the sprit")
  81. tfm.exec.newGame(mapas[math.random(#mapas)])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement