Advertisement
Pontvanilla

Untitled

Mar 30th, 2015
206
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.87 KB | None | 0 0
  1. tfm.exec.snow()
  2. local isInRaceMode = 1
  3. local TimeTicks = 10
  4. banned = {}
  5. toDespawn={}
  6. function eventKeyboard(name,key,down,x,y)
  7.  
  8.  
  9. if tfm.get.room.playerList[name].isFacingRight then
  10. id=tfm.exec.addShamanObject(1,x+40,y,0, 100, 0)
  11. else
  12. id=tfm.exec.addShamanObject(1,x-40,y,0, -100, 0)
  13. end
  14. table.insert(toDespawn,{os.time(),id})
  15.  
  16. end
  17. if key==32 then
  18. tfm.exec.movePlayer(name,0,0,true,0,-50,false)
  19.  
  20. end
  21. local loopCount = 0
  22. function eventLoop(curtime,rcurtime)
  23. for i,cannon in ipairs(toDespawn) do
  24. if cannon[1] <= os.time()-3000 then
  25. tfm.exec.removeObject(cannon[2])
  26. table.remove(toDespawn,i)
  27. end
  28. end
  29. math.randomseed( os.time() )
  30. rndX=math.random(800)
  31. rndP=math.random(20)
  32. rndY=math.random(400)
  33. tfm.exec.displayParticle(rndP, rndX, rndY, 0, 0, 0, 0, nil)
  34. math.randomseed( os.time() )
  35. rndX=math.random(800)
  36. rndP=math.random(20)
  37. rndY=math.random(400)
  38. tfm.exec.displayParticle(rndP, rndX, rndY, 0, 0, 0, 0, nil)
  39. math.randomseed( os.time() )
  40. rndX=math.random(800)
  41. rndP=math.random(20)
  42. rndY=math.random(400)
  43. tfm.exec.displayParticle(rndP, rndX, rndY, 0, 0, 0, 0, nil)
  44. --if loopCount == 0 then
  45. --tfm.exec.snow()
  46. --tfm.exec.snow()
  47. --end
  48. --loopCount = (loopCount + 1) % 100
  49. if isInRaceMode == 1 then
  50. TimeTicks=TimeTicks-1
  51. if TimeTicks == 1 then
  52. raceClearWalls()
  53. isInRaceMode=2
  54. end
  55. end
  56. if isInRaceMode == 0 then
  57. tfm.exec.explosion(1, 1, 999e999, 9999, true)
  58. end
  59. end
  60. function eventChatCommand(name, cmd)
  61. local cmd_args = {}
  62. for arg in cmd:gmatch("[^%s]+") do -- splits the command by spaces.
  63. table.insert(cmd_args, arg) -- inserts them into the table
  64. end
  65. if cmd_args[2] ~= nil then
  66. if cmd_args[1] == "msg" then
  67. ui.addPopup(1,0, name.."вывел на экран сообщение"..cmd_args[2], nil, 0, 20, 800, false)
  68. end
  69. if cmd_args[1] == "map" then
  70. tfm.exec.disableAutoNewGame(true)
  71. tfm.exec.disableAutoScore(true)
  72. tfm.exec.disableAutoShaman(true)
  73. tfm.exec.newGame(cmd_args[2])
  74.  
  75. tfm.exec.setUIMapName("Nobody must know")
  76. tfm.exec.setShaman(name)
  77. end
  78. if cmd_args[1] == "test" then
  79. print("Tested succesfully")
  80.  
  81. end
  82. if cmd_args[1] == "free-build" then
  83. tfm.exec.newGame("<C><P H='800' L='3200' /><Z><S><S L='3000' H='10' X='1600' Y='790' T='1' P='0,0,1,0.2,0,0,0,0' /></S><D /><O /></Z></C>")
  84. for name2, player in pairs(tfm.get.room.playerList) do
  85. tfm.exec.setShaman(name2)
  86. tfm.exec.disableAutoNewGame(true)
  87. tfm.exec.disableAutoScore(true)
  88. tfm.exec.disableAutoShaman(true)
  89.  
  90. end
  91. end
  92.  
  93. if cmd_args[1] == "ban" then
  94. if name == "Pontvanilla" or name == "Romanaveer" then
  95. table.insert(banned, cmd_args[2])
  96. tfm.exec.killPlayer(cmd_args[2])
  97. end
  98. end
  99. end
  100. if cmd_args[1] == "race" then
  101. tfm.exec.disableAutoShaman(true)
  102. tfm.exec.newGame("<C><P L='3000' H='1600' /><Z><S><S L='3000' H='20' X='1490' Y='800' T='6' P='0,0,0.3,0.2,0,0,0,0' /><S L='10' X='1599' H='800' Y='391' T='1' P='0,0,0,0.2,0,0,0,0' /><S L='10' H='1600' X='-5' Y='776' T='1' P='0,0,0,0.2,0,0,0,0' /><S L='1600' o='324650' H='10' X='800' Y='0' T='12' P='0,0,0.3,0.2,0,0,0,0' /><S L='10' H='785' X='1596' Y='398' T='4' P='0,0,20,0.2,0,0,0,0' /><S L='10' H='792' X='-1' Y='395' T='4' P='0,0,20,0.2,0,0,0,0' /><S L='1400' H='10' X='800' Y='80' T='4' P='0,0,20,0.2,0,0,0,0' /><S L='1400' X='800' H='10' Y='180' T='4' P='0,0,20,0.2,0,0,0,0' /><S L='1400' X='800' H='10' Y='280' T='4' P='0,0,20,0.2,0,0,0,0' /><S L='1400' H='10' X='800' Y='380' T='4' P='0,0,20,0.2,0,0,0,0' /><S L='1400' X='800' H='10' Y='480' T='4' P='0,0,20,0.2,0,0,0,0' /><S L='1400' H='10' X='800' Y='580' T='4' P='0,0,20,0.2,0,0,0,0' /><S L='1400' X='800' H='10' Y='680' T='4' P='0,0,20,0.2,0,0,0,0' /><S L='10' H='800' X='760' Y='400' T='4' lua='2' P='0,0,20,0.2,0,0,0,0' /><S L='10' X='800' H='800' Y='400' T='4' lua='1' P='0,0,20,0.2,0,0,0,0' /></S><D><T Y='789' X='20' /><T Y='790' X='1580' /><F Y='569' X='779' /><F Y='669' X='781' /><F Y='787' X='780' /><F Y='470' X='783' /><F Y='370' X='781' /><F Y='269' X='778' /><F Y='170' X='781' /><F Y='71' X='781' /></D><O /></Z></C>")
  103. tfm.exec.disableAutoNewGame(true)
  104. tfm.exec.disableAutoScore(true)
  105.  
  106. tfm.exec.setUIMapName("Race")
  107. isInRaceMode = 1
  108. for name, player in pairs(tfm.get.room.playerList) do
  109. tfm.exec.movePlayer(name, 790, 100, false, 0, 1, false)
  110. end
  111.  
  112. end
  113. if cmd_args[1] == "break" then
  114. if name == "Pontvanlla" then
  115. system.exit()
  116. end
  117. end
  118. if cmd_args[1] == "s" then
  119. tfm.exec.setShaman(name)
  120. end
  121. end
  122. function eventPlayerDied(plr)
  123. tfm.exec.respawnPlayer(plr)
  124.  
  125. if plr == "Joneanony" then
  126. tfm.exec.killPlayer("Jneanonym")
  127. end
  128. end
  129.  
  130. function eventNewPlayer(playerName)
  131.  
  132. for i,key in ipairs({32,40,83}) do
  133. tfm.exec.bindKeyboard(name,key,true,true)
  134. end
  135. --tfm.exec.bindKeyboard(name,32,true,true)
  136. if playerName == "Joneanonym" then
  137. tfm.exec.killPlayer("Joneanonym")
  138. end
  139. ui.addPopup(1,0, "игрок"..playerName, nil, 0, 20, 800, false)
  140. end
  141. function eventPlayerWon(plr, el,elresp)
  142. tfm.exec.respawnPlayer(plr)
  143. if isInRaceMode==3 then
  144. ui.addPopup(1,0, "Лолка "..plr.."!!!", nil, 0, 20, 800, false)
  145. isInRaceMode=0
  146. tfm.exec.setTimeLeft(20)
  147. tfm.exec.disableAutoNewGame(false)
  148. tfm.exec.disableAutoScore(false)
  149. tfm.exec.disableAutoShaman(false)
  150.  
  151.  
  152. end
  153. end
  154. for name,player in pairs(tfm.get.room.playerList) do
  155. system.bindMouse(name, true)
  156. tfm.exec.bindKeyboard(name, 39, true, true)
  157. tfm.exec.bindKeyboard(name,32,true,true)
  158.  
  159. end
  160.  
  161. function eventMouse(name, x, y)
  162.  
  163. rndP=math.random(20)
  164. tfm.exec.displayParticle(rndP, x, y, 0, 0, 1, 0, nil)
  165. rndP=math.random(20)
  166. tfm.exec.displayParticle(rndP, x, y, 0, 0, 0, 1, nil)
  167. rndP=math.random(20)
  168. tfm.exec.displayParticle(rndP, x, y, 0, 0, 1, 0, nil)
  169. rndP=math.random(20)
  170. tfm.exec.displayParticle(rndP, x, y, 0, 0, 0, 1, nil)
  171. rndP=math.random(20)
  172. tfm.exec.displayParticle(rndP, x, y, 0, 0, 1, 0, nil)
  173. --tfm.exec.movePlayer(name, x, y, false, 0, 0, true)
  174. tfm.exec.explosion(x, y, 999999, 50, false)
  175. tfm.exec.displayParticle(5, x, y, 9999, 1, 0, 0, nil)
  176. end
  177. function raceClearWalls()
  178. tfm.exec.removePhysicObject(1)
  179. tfm.exec.removePhysicObject(2)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement