Advertisement
Guest User

Untitled

a guest
May 25th, 2016
350
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.30 KB | None | 0 0
  1. tfm.exec.disableAutoScore(true)
  2. tfm.exec.disableAutoShaman(true)
  3. tfm.exec.disableAutoNewGame(true)
  4. tfm.exec.disableAfkDeath(true)
  5. tfm.exec.disableAutoTimeLeft(true)
  6. system.disableChatCommandDisplay('map1', true)
  7. system.disableChatCommandDisplay('map2', true)
  8. system.disableChatCommandDisplay('map3', true)
  9. system.disableChatCommandDisplay('map4', true)
  10. system.disableChatCommandDisplay('map5', true)
  11. system.disableChatCommandDisplay('map6', true)
  12. system.disableChatCommandDisplay('reset',true)
  13. system.disableChatCommandDisplay('mort',true)
  14. easymaps={113156,168754,586901,306384, 204647, 4313858, 1610638, 3734996, 3737744, 393426, 783547, 2469365, 1296299, 449496, 1000006, 496886, 270924, 2693344, 167333, 3937567, 3513929, 2854813, 608368, 3820501, 212322, 3337127, 2239788, 277513}
  15. mediummaps={149451,150651,151655,152733,155480,156720,160841,651656,304861,1102513,395310,185529, 2818330, 332906, 213874, 1398609, 365061, 2636207, 2297260, 3219400 , 2817711, 2789121, 2050389, 408643, 397467, 1157281, 692650, 163596, 301610 , 185428, 2520540, 208056, 556575, 232675, 541693, 242291, 3041105, 438333, 281948, 692740, 564198, 318129 , 270924, 231137, 305820, 179807, 1066607, 515684, 225744, 684566, 467137, 220352 , 222377, 1737297, 492399, 1266330, 295630, 205506, 3008319, 376704 , 184868, 302080, 444589, 368585, 257092}
  16. hardmaps={1989803,4578236, 2819876,2877042,2999994,3200001,355336,2963166,259319,536905,3826546,4000009,2932238, 2311703, 3750360, 1004622, 2750014, 552986, 3012311, 733146, 1737800, 4093488, 3551333, 584783, 722837, 1046877, 574183, 3908151, 758595, 3988424, 1989803, 4484685, 587501, 3343092, 2395201, 3938895, 1737914, 2772507, 1301649, 203664, 721319, 2423300, 209848, 4220381, 4000007, 299983, 1494499, 4121359, 2416969, 3292308, 4000008, 1952415, 3969628, 3118161 }
  17. yikesmaps={4209243, 4532470, 5085011, 4720851, 3038589, 397478, 4948551, 4794517, 1111252, 3976766}
  18. easyno=table.getn(easymaps)
  19. mediumno=table.getn(mediummaps)
  20. hardno=table.getn(hardmaps)
  21. yikesno=table.getn(yikesmaps)
  22. bestplayer="N/A"
  23. bestplayer2="N/A"
  24. bestplayer3="N/A"
  25. playerlist={"Realounay","Cloude","Rpownz","Mcsguigf","Mezarbekcisi","Eduardomol","Bleees","Franquin","Gohoq","Ochey"}
  26. playertrue={Realounay=true,Mcsguigf=true,Cloude=true,Rpownz=true,Mezarbekcisi=true,Eduardomol=true,Bleees=true,Franquin=true,Gohoq=true,Ochey=true}
  27. scores={}
  28. x=0
  29. e=1
  30. for i,n in pairs(playerlist) do
  31. scores[n]=0
  32. tfm.exec.setPlayerScore(n,scores[n],false)
  33. tfm.exec.bindKeyboard(n,8,true,true)
  34. end
  35. tfm.exec.newGame('#13')
  36. function eventNewPlayer(name)
  37. if playertrue[name] then
  38. tfm.exec.bindKeyboard(name,8,true,true)
  39. tfm.exec.respawnPlayer(name)
  40. tfm.exec.setPlayerScore(name,scores[name],true)
  41. tfm.exec.chatMessage(name .. " has joined!")
  42. end
  43. if name == "Yogiibear" then
  44. tfm.exec.respawnPlayer(name)
  45. end
  46. end
  47. function eventNewGame()
  48. print("Start")
  49. for i,n in pairs(tfm.get.room.playerList) do
  50. tfm.exec.killPlayer(i)
  51. end
  52. if bestplayer ~= "N/A" then
  53. if playertrue[bestplayer] then
  54. scores[bestplayer]=scores[bestplayer]+5
  55. tfm.exec.chatMessage(bestplayer .. " was fastest, completing the map in " .. besttime1/100 .. "s, earning 5 bonus points!")
  56. end
  57. end
  58. if bestplayer2 ~= "N/A" then
  59. if playertrue[bestplayer2] then
  60. scores[bestplayer2]=scores[bestplayer2]+3
  61. tfm.exec.chatMessage(bestplayer2 .. " was second fastest, completing the map in " .. besttime2/100 .. "s, earning 3 bonus points!")
  62. end
  63. end
  64. if bestplayer3 ~= "N/A" then
  65. if playertrue[bestplayer3] then
  66. scores[bestplayer3]=scores[bestplayer3]+1
  67. tfm.exec.chatMessage(bestplayer3 .. " was third fastest, completing the map in " .. besttime3/100 .. "s, earning 1 bonus point")
  68. end
  69. end
  70. for i,n in pairs(playerlist) do
  71. if playertrue[n] then
  72. tfm.exec.setPlayerScore(n,scores[n],false)
  73. tfm.exec.respawnPlayer(n)
  74. end
  75. end
  76. tfm.exec.setGameTime(360)
  77. x=x+1
  78. y=x%3
  79. pointsremaining=5
  80. besttime1=1000000
  81. besttime2=1000001
  82. besttime3=1000002
  83. bestplayer=""
  84. bestplayer2=""
  85. bestplayer3=""
  86. tfm.exec.setUIShamanName("Fastest: N/A | Time: N/A s")
  87. tfm.exec.setUIMapName("")
  88. e=1
  89. end
  90. function eventKeyboard(name, key, down, xPlayerPosition, yPlayerPosition)
  91. if key==8 then
  92. tfm.exec.killPlayer(name)
  93. tfm.exec.respawnPlayer(name)
  94. end
  95. end
  96. function eventChatCommand(name, cmd)
  97. local cmd_args={}
  98. for arg in cmd:gmatch("[^%s]+") do
  99. table.insert(cmd_args, arg)
  100. end
  101. if cmd=="mort" then
  102. if playertrue[name] then
  103. tfm.exec.killPlayer(name)
  104. tfm.exec.respawnPlayer(name)
  105. end
  106. end
  107. if name=="Yogiibear" then
  108. if cmd_args[1]=="map" then
  109. tfm.exec.newGame(cmd_args[2])
  110. end
  111. if cmd=="end" then
  112. tfm.exec.newGame(0)
  113. end
  114. if cmd=="easymap" then
  115. tfm.exec.newGame(easymaps[math.random(easyno)])
  116. end
  117. if cmd=="mediummap" then
  118. medrn=math.random(mediumno)
  119. print(medrn)
  120. tfm.exec.newGame(mediummaps[medrn])
  121. end
  122. if cmd=="hardmap" then
  123. tfm.exec.newGame(hardmaps[math.random(hardno)])
  124. end
  125. if cmd=="vhardmap" then
  126. tfm.exec.newGame(yikesmaps[math.random(yikesno)])
  127. end
  128. if cmd=="reset" then
  129. tfm.exec.newGame(0)
  130. x=0
  131. bestplayer=""
  132. bestplayer2=""
  133. bestplayer3=""
  134. for i,n in pairs(playerlist) do
  135. scores[n]=0
  136. tfm.exec.respawnPlayer(i)
  137. tfm.exec.bindKeyboard(n,8,true,true)
  138. tfm.exec.setPlayerScore(n,0,false)
  139. end
  140. end
  141. if cmd=="win" then
  142. tfm.exec.giveCheese(name)
  143. tfm.exec.playerVictory(name)
  144. end
  145. if cmd=="top3" then
  146. tfm.exec.chatMessage(bestplayer .. " " .. besttime1/100 .. "s | " .. bestplayer2 .. " " .. besttime2/100 .. "s | " .. bestplayer3 .. " " .. besttime3/100 .. "s")
  147. end
  148. if cmd=="scores" then
  149. print(scores[name])
  150. end
  151. end
  152. end
  153. function eventPlayerWon(name,time,time2)
  154. if e==1 then
  155. if playertrue[name] then
  156. print(time/100 .. " " .. name .. " " .. time2/100)
  157. tfm.exec.chatMessage(name .. " completed the map in " .. time2/100 .. "s earning ".. pointsremaining .. " points")
  158. scores[name]=scores[name]+pointsremaining
  159. tfm.exec.setPlayerScore(name,pointsremaining,true)
  160. if pointsremaining>1 then
  161. pointsremaining=pointsremaining-1
  162. end
  163. if time2 < besttime1 then
  164. besttime3=besttime2
  165. bestplayer3=bestplayer2
  166. besttime2=besttime1
  167. bestplayer2=bestplayer
  168. besttime1=time2
  169. bestplayer=name
  170. tfm.exec.setUIShamanName(bestplayer .. " " .. besttime1/100 .. "s | " .. bestplayer2 .. " " .. besttime2/100 .. "s | " .. bestplayer3 .. " " .. besttime3/100 .. "s")
  171. elseif time2 < besttime2 then
  172. besttime3=besttime2
  173. bestplayer3=bestplayer2
  174. besttime2=time2
  175. bestplayer2=name
  176. tfm.exec.setUIShamanName(bestplayer .. " " .. besttime1/100 .. "s | " .. bestplayer2 .. " " .. besttime2/100 .. "s | " .. bestplayer3 .. " " .. besttime3/100 .. "s")
  177. elseif time2 < besttime3 then
  178. besttime3=time2
  179. bestplayer3=name
  180. tfm.exec.setUIShamanName(bestplayer .. " " .. besttime1/100 .. "s | " .. bestplayer2 .. " " .. besttime2/100 .. "s | " .. bestplayer3 .. " " .. besttime3/100 .. "s")
  181. end
  182. end
  183. end
  184. tfm.exec.respawnPlayer(name)
  185. end
  186. function eventPlayerDied(name)
  187. if playertrue[name] then
  188. tfm.exec.respawnPlayer(name)
  189. end
  190. if name== "Yogiibear" then
  191. tfm.exec.respawnPlayer(name)
  192. end
  193. end
  194. function eventLoop(a,b)
  195. if b<=0 then
  196. if e==1 then
  197. tfm.exec.chatMessage("Time is up!")
  198. e=e-1
  199. end
  200. end
  201. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement