Advertisement
Dudugz-Contistente

Untitled

Oct 12th, 2017
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.34 KB | None | 0 0
  1. tfm.exec.disableAutoShaman();
  2. tfm.exec.disableAutoNewGame();
  3. tfm.exec.disableAutoTimeLeft();
  4.  
  5. maps_, data, shootCN, c, difficulty = {6953348,7214244,6891734,1539148,6549805,495880,6684273,1026249,6622204,741041,6631961,1545834,291643,1485498,860865,6240668,802958,7042435,2842113,6938129,1794873,311496,392646,7049134,1519483,7142792,3540608,852617,279689,399420,281649,289964,390649,2284187,289932,281462,866256,6999034,280159,3107377,307930,6789296,1659906,306360,6793381,697561,3587860,290546,6786189,481676}, {}, os.time(), {x=nil,y=nil,mx=math.random(80,180),my=math.random(-20,20),isFacingRight=false,dir=0,angle=0},{nvl=1,tm=2000,new=os.time()}
  6.  
  7. effect={0,4}
  8. mapCode='@Nil'
  9. nextMap=false
  10.  
  11. textarea=ui.addTextArea
  12. function ui.addTextArea(id,text,targetPlayer,x,y,width,height,backgroundColor,borderColor,backgroundAlpha,emboss,active,active2)
  13. --if not backgroundColor then backgroundColor=0x324650 end
  14. --if not borderColor then borderColor=0x000001 end
  15. if active then
  16. textarea(6969+id,"",targetPlayer,x,y+1,width,height,0x000001,0x000001,backgroundAlpha)
  17. textarea(7979+id,"",targetPlayer,x,y-1,width,height,0x6A8FA2,0x6A8FA2,backgroundAlpha)
  18. end
  19.  
  20. if active2 then
  21. textarea(6969+id,"",targetPlayer,x,y+1,width,height,0x000001,0x000001,backgroundAlpha)
  22. end
  23.  
  24. textarea(id,text,targetPlayer,x,y,width,height,backgroundColor,borderColor,backgroundAlpha)
  25. end
  26.  
  27. getRandomData=function()
  28. local players = {}
  29. for n,v in pairs(tfm.get.room.playerList) do if not v.isDead then table.insert(players,v) end end
  30. return players[math.random(#players)]
  31. end
  32.  
  33. function eventNewGame() nextMap = false mapCode = tfm.get.room.currentMap tfm.exec.setGameTime(70) shootCN = os.time() c.x = nil c.y = nil difficulty.nvl = 1 difficulty.tm = 2000 difficulty.new = os.time() end
  34.  
  35. ScoreBoard=function(...)
  36. if ... =='close' then
  37. for i = 3940,3946 do
  38. for _,id in pairs({i,6969+i,7979+i}) do ui.removeTextArea(id,nil) end
  39. end
  40. elseif ... =='open' then
  41. local players, positions, names, points = {}, "", "", ""
  42.  
  43. for n, v in pairs(tfm.get.room.playerList) do
  44. if #players < 6 then
  45. if v.score >= 500 then
  46. v.score=500
  47. tfm.exec.setPlayerScore(n,500,false)
  48. end
  49.  
  50. players[#players+1] = {n=n,p=v.score}
  51. else
  52. break
  53. end
  54. end
  55.  
  56. table.sort(players,function(a,b) return a.p>b.p end)
  57.  
  58. for k,p in pairs(players) do
  59. m = k
  60. if m < 10 then m = '0'..m end
  61. positions = positions.."<J>"..m..".</J><br><br>"
  62. names = names.."<V>"..p.n.."</V><br><br>"
  63. points = points.."<G>"..p.p.."</G><br><br>"
  64. end
  65.  
  66. ui.addTextArea(3940,"",nil,250,50,300,222,0x324650,0x324650,nil,true,true)
  67. ui.addTextArea(3941,"<p align='center'><font size='14'><N2>ScoreBoard (Top 6)</N2></p></p>",nil,250,51,300,20,0x324650,0x324650,1,true,false,true)
  68. ui.addTextArea(3942,"<J>##.</J> <V> PlayerName </V> <G>Points</G><br><N2>_________________________________________</N2>",nil,252,90,296,180,0x22333b,0x22333b,1,true,false,false)
  69. ui.addTextArea(3943,positions,nil,252,120,25,180,0,0,0,true)
  70. ui.addTextArea(3944,names,nil,280,120,100,180,0,0,0,true)
  71. ui.addTextArea(3945,points,nil,370,120,40,180,0,0,0,true)
  72. ui.addTextArea(3946,"<N2><br><br><br>_________________________________________<br><br>_________________________________________<br><br>_________________________________________<br><br>_________________________________________<br><br>_________________________________________</N2>",nil,252,90,296,180,0,0,0,true,false,true)
  73. end
  74. end
  75.  
  76. function eventLoop(t,r)
  77. if t < 3000 then
  78. shootCN = os.time();
  79. end
  80.  
  81. if r <= 5000 then
  82. for i,v in pairs(tfm.get.room.playerList) do if not v.isDead then tfm.exec.giveCheese(i)tfm.exec.playerVictory(i) end end
  83. end
  84.  
  85. if t >= 3000 then
  86. local a = 0; for i,v in pairs(tfm.get.room.playerList) do if not v.isDead then a=a+1 end end
  87. if not nextMap and (a == 0 or r <= 5000) then nextMap=true tfm.exec.setGameTime(10) end
  88. if nextMap and (r <= 10000) then if (r <= 0) then tfm.exec.newGame(maps_[math.random(#maps_)]) ScoreBoard('close') else ScoreBoard('open') end end
  89.  
  90. if difficulty.new < os.time()-15000 then
  91. difficulty.nvl = difficulty.nvl + 1
  92. difficulty.tm = difficulty.tm - 500
  93. difficulty.new = os.time();
  94. end
  95.  
  96. if c.x == nil and c.y == nil then
  97. p = getRandomData();
  98.  
  99. if p ~= nil then
  100. c.x = p.x
  101. c.y = p.y
  102. c.dir = math.random(1,9)
  103. c.mx = (c.dir ~= 3 and math.random(80,180) or math.random(-10,10))
  104. c.my = (c.dir ~= 3 and math.random(-20,20) or -math.random(80,250))
  105. c.isFacingRight=p.isFacingRight
  106. c.angle = (c.dir ~= 3 and (c.isFacingRight and math.random(260,275) or math.random(80,95)) or math.random(175,185))
  107. if c.angle >= 80 and c.angle <= 95 then c.angle_ = c.angle-180 end
  108. if c.angle >= 175 and c.angle <= 185 then c.angle_ = c.angle-180 end
  109. if c.angle >= 260 and c.angle <= 275 then c.angle_ = c.angle-180 end
  110. --c.angle_ = (c.angle < 0 and -1*(c.angle_) or c.angle)
  111. else
  112. c.x = -999
  113. c.y = -999
  114. c.mx = 0
  115. c.my = 0
  116. c.isFacingRight=false
  117. end
  118. end
  119.  
  120. if c.x ~= -999 and c.y ~= -999 then
  121. if shootCN < os.time()-(difficulty.tm/2) then tfm.exec.addShamanObject(0,(c.x+(c.isFacingRight and c.mx or -c.mx))+math.random(-4,4), (c.dir ~= 3 and (c.y+(p.isFacingRight and c.my or -c.my)) or c.y+c.my),c.angle_) end
  122. for i=1,math.random(2,5) do tfm.exec.displayParticle (effect[math.random(#effect)], (c.x+(c.isFacingRight and c.mx or -c.mx))+math.random(-4,4), (c.y+(p.isFacingRight and c.my or -c.my)), 0, math.random(0.8,2)) end
  123. if shootCN < os.time()-difficulty.tm then a = (c.dir ~= 3 and tfm.exec.addShamanObject((not c.isDead and 17 or -1),(not c.isDead and (c.isFacingRight and c.x+c.mx or c.x-c.mx) or nil),c.y+c.my,c.angle) or tfm.exec.addShamanObject((not c.isDead and 17 or -1),(not c.isDead and (c.isFacingRight and c.x+c.mx or c.x-c.mx) or nil),c.y+c.my,c.angle)) c.x=nil c.y=nil shootCN = os.time(); end
  124. end
  125. end
  126.  
  127. ui.setMapName("Auto Survivor <BL>|</BL> <G>"..mapCode.."</G> <BL>|</BL> <N>Difficulty : <V>"..difficulty.nvl.."</V></N>")
  128. end
  129.  
  130. function eventNewPlayer(name)
  131. tfm.exec.chatMessage("<FC>Este minigame se encontra em fase beta e não está 100% conclúido.</FC>",name)
  132. end
  133.  
  134. for _,v in pairs(tfm.get.room.playerList) do eventNewPlayer(_) if v.score > 0 then tfm.exec.setPlayerScore(_,0,false) end end
  135.  
  136. tfm.exec.newGame(maps_[math.random(#maps_)])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement