Mousetat

Troll Lua vanilla

Jan 7th, 2017
384
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.47 KB | None | 0 0
  1. tfm.exec.disableAutoNewGame(true)
  2. map="0"
  3. mapping=false
  4. trollbool=false
  5. trollrandom=math.random(2,5)
  6. trollcount=0
  7. first=false
  8.  
  9. admin1="Tat#0020"
  10. admin2="Camelshet#2851"
  11. admin3="Trapin"
  12. admin4="Mimidonut"
  13. admin5="Destinyruiz" --don't add admin6 unless u know how to code this.
  14.  
  15. colorpicked=0xE68D43
  16.  
  17. function eventNewGame()
  18. tfm.exec.setUIMapName("#TrollVanilla")
  19. tfm.exec.addImage("1544dc69486.jpg","?3",0,0)
  20. for name,player in pairs(tfm.get.room.playerList) do
  21. end
  22. nocheese=false
  23. balls=false
  24. swap2=false
  25. if troll==true then
  26. tfm.exec.chatMessage("<font color='#"..tostring(colorpicked).."'>["..tfm.get.room.name.."] Trolololololol</font>",nil)
  27. end
  28. end
  29. tfm.exec.addImage("1544dc69486.jpg","?3",0,0)
  30. system.disableChatCommandDisplay("s all", true)
  31. system.disableChatCommandDisplay("vampire", true)
  32. system.disableChatCommandDisplay("troll", true)
  33. system.disableChatCommandDisplay("nocheese", true)
  34. system.disableChatCommandDisplay("balls", true)
  35. system.disableChatCommandDisplay("swap", true)
  36. system.disableChatCommandDisplay("help", true)
  37. system.disableChatCommandDisplay("m", true)
  38. system.disableChatCommandDisplay("np", true)
  39. system.disableChatCommandDisplay("s all", true)
  40. troll=false
  41.  
  42.  
  43.  
  44. function eventColorPicked(colorPickerId, playerName, color )
  45. colorpicked=string.format("%X", color)
  46. end
  47.  
  48. p={}
  49. trollmaps={"@4500045", "@5651178", "@5018395", "@6010060", "@6124757", "@6123862", "@5929021", "@6178788", "@6133069", "@6127609", "@6222523", "@6222598", "@6222662", "@6113351", "@6422227", "@5018481", "@5543945", "@6122745", "@6130459", "@6135167", "@6313103", "@5018508", "@5858646", "@6127224", "@6123442", "@5977759", "@6135200", "@5932565", "@6110650", "@5018552", "@5528077", "@5018625", "@5858647", "@1395371", "@6207985", "@6218403", "@6329560", "@6179538", "@5622009", "@5875455", "@6192664", "@5018731", "@6044446", "@5858583", "@5858585", "@5966424", "@5966445", "@5704644", "@6173496", "@5436800", "@6329565", "@5018771", "@5719514", "@5704627", "@6125960", "@6127589", "@6127747", "@6192402", "@6184390", "@6329568", "@5018836", "@5719492", "@5858628", "@6124001", "@5564186", "@6217094", "@5018961", "@5858631", "@5640463", "@6217035", "@6186461", "@4040403", "@5019057", "@5621250", "@6172370", "@5436588", "@6207483", "@6222159", "@5019123", "@5019191", "@6126005", "@5436981", "@5019223", "@6232081", "@6232089", "@6232095", "@6232098", "@5019302", "@5440478", "@6206380", "@5621960", "@6127550", "@6136351", "@6217055", "@6369921", "@6108198", "@5019328", "@5629311", "@5803326", "@5858564", "@5858586", "@5858587", "@5918098", "@5966392", "@5966405", "@1193082", "@6186304", "@5543399", "@5019350", "@5719394", "@5949452", "@6115548", "@5019382", "@6173592", "@6172417", "@5019421", "@6186328", "@5457626", "@6126256", "@5543671", "@5019530", "@5564274", "@6205274", "@5048881", "@6156082", "@6277845", "@5621395", "@5724761", "@5724763", "@5724765", "@5966396", "@6094395", "@5565050", "@5605309", "@6277853", "@6313226", "@5049526", "@5704629", "@6270048", "@5910464", "@5966432", "@5966438", "@6126145", "@6127710", "@6127719", "@6377332", "@6148478", "@6314518", "@6127135", "@5621346", "@5049660", "@5875460", "@5875461", "@5628930", "@6172472", "@6186377", "@6189703", "@5910501", "@6127290", "@6223454", "@6132502", "@6127154", "@6332528", "@5018652", "@5836826", "@5858595", "@5858625", "@5858639", "@6124832", "@6127211", "@5602310", "@6244710", "@6250422", "@5595910", "@5858644", "@6147952", "@5621139", "@5621147", "@6272568", "@5621219", "@5910108", "@6107893", "@6190625", "@5605249", "@6254763", "@5910088", "@6119333", "@5966429", "@5949462", "@6203629", "@6186396", "@6205616", "@6207848", "@4157329", "@5910104", "@6173687", "@6116175", "@5910095", "@6189594", "@6313270", "@5858581", "@5858632", "@6104360", "@5436707", "@6329552", "@6400422", "@5803313", "@5918089", "@5649499", "@6174089", "@5621196", "@6125319", "@5960204", "@6205095", "@6205714", "@5949349", "@5723872", "@5836910", "@5858598", "@5902874", "@6127184", "@6335762", "@5858641", "@5902875", "@6127705", "@5605065", "@6205203", "@6100256", "@5621555", "@5910116", "@6174019", "@5910077", "@5862868", "@5862874", "@6192863", "@5621716", "@5852948", "@5854243", "@5621865", "@6122725", "@6113306", "@5836845", "@6185835", "@5050018", "@6189570", "@2721399", "@5875458", "@6400412", "@6299153", "@5580276", "@6299335"}
  50. maps={0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30}
  51. id=0
  52.  
  53. function eventChatCommand(name, message)
  54. if name==admin1 or name==admin2 or name==admin3 or name==admin4 or name==admin5 then
  55. if message=="s all" then
  56. tfm.exec.chatMessage("<font color='#"..tostring(colorpicked).."'>["..tfm.get.room.name.."]".." Go! Fight shamans!</font>",nil)
  57. for name,player in pairs(tfm.get.room.playerList) do
  58. tfm.exec.setShaman(name)
  59. end
  60. elseif message=="color" then
  61. ui.showColorPicker (1, name, 0xE68D43, "Color" )
  62. elseif message=="vampire" then
  63. tfm.exec.chatMessage("<font color='#"..tostring(colorpicked).."'>["..tfm.get.room.name.."]".." A random mouse has been chosen as a vampire. RUN!!!</font>",nil)
  64. for name, player in pairs(tfm.get.room.playerList) do
  65. table.insert(p, name)
  66. end
  67. tfm.exec.setVampirePlayer(p[math.random(1,#p)])
  68. for name, player in pairs(tfm.get.room.playerList) do
  69. table.remove(p)
  70. end
  71. elseif message=="troll" then
  72. troll=true
  73. elseif message=="nocheese" then
  74. tfm.exec.chatMessage("<font color='#"..tostring(colorpicked).."'>["..tfm.get.room.name.."]".." Don't get the cheese! It's poisonous!</font>",nil)
  75. nocheese=true
  76. elseif message=="balls" then
  77. tfm.exec.chatMessage("<font color='#"..tostring(colorpicked).."'>["..tfm.get.room.name.."]".." IT'S RAINING BALLS!!!</font>",nil)
  78. balls=true
  79. elseif message:sub(0,1)=="m" then
  80. tfm.exec.chatMessage("<font color='#"..tostring(colorpicked).."'>["..tfm.get.room.name.."] "..message:sub(3).."</font>",nil)
  81. elseif message=="swap" then
  82. tfm.exec.chatMessage("<font color='#"..tostring(colorpicked).."'>["..tfm.get.room.name.."]".." It's time to swap people around hehe</font>",nil)
  83. swap=true
  84. elseif message:sub(0,2)=="np" then
  85. tfm.exec.newGame(message:sub(4))
  86. elseif message=="help" then
  87. tfm.exec.chatMessage("<font color='#"..tostring(colorpicked).."'>["..tfm.get.room.name.."] The commands are: swap, balls, nocheese, troll, vampire, s all, help, np @code, color</font>",name)
  88. elseif message=="skip" then
  89. tfm.exec.newGame(maps[math.random(#maps)])
  90. end
  91. end
  92. end
  93.  
  94. timestamp=999999999999999999999999999999
  95. choose=0
  96.  
  97. function eventLoop(time,remaining)
  98. local iz=0
  99. for n,player in pairs(tfm.get.room.playerList) do
  100. if not player.isDead then
  101. iz=iz+1
  102. end
  103. end
  104. if iz==0 then
  105. choose=math.random(#maps)
  106. tfm.exec.newGame(maps[choose])
  107.  
  108. end
  109. if remaining<=0 then
  110.  
  111. if troll==true then
  112. tfm.exec.newGame(trollmaps[math.random(#trollmaps)])
  113. else
  114. if not trollrandom==trollcount then
  115. tfm.exec.newGame(maps[math.random(#maps)])
  116. trollcount=trollcount+1
  117. else
  118. tfm.exec.newGame(trollmaps[math.random(#trollmaps)])
  119. troll=true
  120. trollrandom=math.random(2,5)
  121. end
  122. end
  123. first=false
  124. end
  125. if balls==true then
  126. tfm.exec.addShamanObject(6, math.random(0,800), -300, 0, 0, 5, false)
  127. end
  128. if swap==true then
  129. timestamp=time
  130. swap=false
  131. swap2=true
  132. end
  133. if time>timestamp+10000 and swap2==true then
  134. timestamp=time
  135. tfm.exec.chatMessage("<font color='#"..tostring(colorpicked).."'>["..tfm.get.room.name.."] SWAP!</font>",nil)
  136. for name, player in pairs(tfm.get.room.playerList) do
  137. table.insert(p, name)
  138. end
  139. count=#p
  140. while count>1 do
  141. random1=math.random(1,#p)
  142. x1=tfm.get.room.playerList[p[random1]].x
  143. y1=tfm.get.room.playerList[p[random1]].y
  144. name1=p[random1]
  145. table.remove(p,random1)
  146. random2=math.random(1,#p)
  147. x2=tfm.get.room.playerList[p[random2]].x
  148. y2=tfm.get.room.playerList[p[random2]].y
  149. name2=p[random2]
  150. table.remove(p,random2)
  151. tfm.exec.movePlayer(name1,x2,y2,false,0,0,false)
  152. tfm.exec.movePlayer(name2,x1,y1,false,0,0,false)
  153. count=count-2
  154. end
  155. if count==1 then
  156. table.remove(p)
  157. end
  158. end
  159. end
  160.  
  161. function eventPlayerDied()
  162. local i=0
  163. for n,player in pairs(tfm.get.room.playerList) do
  164. if not player.isDead then
  165. i=i+1
  166. end
  167. end
  168. if i==0 then
  169. if troll==true then
  170. tfm.exec.newGame(trollmaps[math.random(#trollmaps)])
  171. else
  172. tfm.exec.newGame(maps[math.random(#maps)])
  173. end
  174. end
  175. end
  176.  
  177. function eventPlayerGetCheese(name)
  178. if nocheese==true then
  179. tfm.exec.killPlayer(name)
  180. tfm.exec.chatMessage("<font color='#"..tostring(colorpicked).."'>["..tfm.get.room.name.."] Told ya!",name)
  181. end
  182. end
  183.  
  184. tfm.exec.newGame(maps[math.random(#maps)])
  185.  
  186. function eventNewPlayer(name)
  187. print(name)
  188. end
  189.  
  190. for name,player in pairs(tfm.get.room.playerList) do
  191. eventNewPlayer(name)
  192. end
Advertisement
Add Comment
Please, Sign In to add comment