Advertisement
Guest User

Script Lua - Chão é lava

a guest
Aug 16th, 2018
756
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.34 KB | None | 0 0
  1. map={
  2. 7214563,
  3. 7273409
  4. }
  5. tfm.exec.setGameTime(6000,true)
  6. tfm.exec.disableAutoShaman(true)
  7. tfm.exec.disableAutoNewGame(true)
  8. tfm.exec.setUIMapName("The floor is lava!")
  9. tfm.exec.newGame(map[math.random(#map)])
  10. ilosc = 10
  11. for name, player in pairs(tfm.get.room.playerList) do
  12. tfm.exec.setPlayerScore(name,0)
  13. end
  14. tfm.exec.addPhysicObject(1,800,387,{
  15. type=6,
  16. restitution=0.2,
  17. friction=0.3,
  18. width=1600,
  19. height=37,
  20. groundCollision=true,
  21. miceCollision=true
  22. })
  23. to=0
  24. czas=10
  25. score = 0
  26.  
  27.  
  28. function eventLoop(timeRemaining,timeRemaining)
  29. if(to==2) then
  30. czas=czas-1
  31. score = score + 1
  32. if(score==10) then
  33. for name, player in pairs(tfm.get.room.playerList) do
  34. tfm.exec.giveMeep(name)
  35. end
  36. end
  37. if(czas==3) then
  38. usun = tfm.exec.addShamanObject(math.random(1,7),math.random(100,1500),350,0,0,0,false)
  39. usunn = tfm.exec.addShamanObject(math.random(1,7),math.random(100,1500),350,0,0,0,false)
  40.  
  41. end
  42. if(czas==-3) then
  43. tfm.exec.removeObject(usun)
  44. tfm.exec.removeObject(usunn)
  45.  
  46. ilosc = ilosc - 1
  47. czas=ilosc
  48. tfm.exec.addPhysicObject(1,800,387,{
  49. type=6,
  50. restitution=0.2,
  51. friction=0.3,
  52. width=1600,
  53. height=37,
  54. groundCollision=true,
  55. miceCollision=true
  56. })
  57. tfm.exec.removePhysicObject(2)
  58. end
  59.  
  60. if(czas<=0) then
  61.  
  62. tfm.exec.addPhysicObject(1,800,387,{
  63. type=6,
  64. restitution=0.2,
  65. friction=0.3,
  66. width=1600,
  67. height=37,
  68. groundCollision=true,
  69. miceCollision=false
  70. })
  71. tfm.exec.addPhysicObject(2,800,387,{
  72. type=3,
  73. restitution=0.2,
  74. friction=0.3,
  75. width=1600,
  76. height=37,
  77. groundCollision=true,
  78. miceCollision=false
  79. })
  80.  
  81. ui.addTextArea(7, "<p align='center'><font size='50' color='#FF0000'>O CHÃO É LAVA!!!!</font></p>", nil, 50, 125, 700, 119, 0x324650, 0x000000, 0, true,true)
  82. else
  83. ui.addTextArea(7, "<p align='center'><font size='90'>"..czas.."</font></p>", nil, 50, 125, 700, 119, 0x324650, 0x000000, 0, true,true)
  84. ui.addTextArea(5,"", nil, 50, 250, 700, 119, 0x324650, 0x000000, 0, true,true)
  85. end
  86. to=0
  87. else
  88. to=to+1
  89. end
  90. if(ilosc==4) then
  91. ilosc=10
  92. end
  93. end
  94. liczba=0
  95. tablica={}
  96. zycie={}
  97. e=0
  98. for name, player in pairs(tfm.get.room.playerList) do
  99. tablica[name]=0
  100. e=e+1
  101.  
  102. print(name)
  103. end
  104. print(e)
  105. function eventPlayerDied(n)
  106. tfm.exec.setUIShamanName(n.." has died.")
  107. tfm.exec.setPlayerScore(n,-2,true)
  108. tablica[n]=1
  109. zycie[n]=0
  110. e=e-1
  111. print(e)
  112. for name, player in pairs(tfm.get.room.playerList) do
  113. if(tablica[name]==0) then
  114. liczba=liczba+1
  115. wyg=name
  116. end
  117. end
  118. function eventPlayerLeft(n)
  119. tablica[n]=1
  120. zycie[n]=0
  121. e=e-1
  122. print(e)
  123. for name, player in pairs(tfm.get.room.playerList) do
  124. if(tablica[name]==0) then
  125. liczba=liczba+1
  126. wyg=name
  127. end
  128. end
  129. end
  130. if(liczba==1) then
  131. print(wyg.." wygral")
  132. tfm.exec.giveCheese(wyg)
  133. ui.addTextArea(5, "<p align='center'><font size='50' color='#FFFF00'>"..wyg.." Ganhou a partida!!!</font></p>", nil, 50, 250, 700, 500, 0x324650, 0x000000, 0, true,true)
  134. tfm.exec.playerVictory(wyg)
  135. tfm.exec.newGame(map[math.random(#map)])
  136. tfm.exec.addPhysicObject(1,800,387,{
  137. type=6,
  138. restitution=0.2,
  139. friction=0.3,
  140. width=1600,
  141. height=37,
  142. groundCollision=true,
  143. miceCollision=true
  144. })
  145. to=0
  146. czas=10
  147. score = 0
  148. e=0
  149. tablica={}
  150. ilosc=10
  151. tfm.exec.setPlayerScore(wyg,score,true)
  152. for name, player in pairs(tfm.get.room.playerList) do
  153. tablica[name]=0
  154. zycie[name]=1
  155. e=e+1
  156. end
  157. wyg=""
  158. liczba=0
  159. print(e)
  160. else
  161. liczba=0
  162. end
  163. end
  164. function eventPlayerRespawn(nn)
  165. if(zycie[nn]==0) then
  166. tfm.exec.setVampirePlayer(nn)
  167. end
  168. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement