Advertisement
Guest User

real

a guest
Aug 27th, 2016
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.37 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={4627777,3888888,4488666,1646448,549666,3380788,2738370,496610,460961,444589,438333,435812,432501,431749,4237910,3999991,3866663,3866660,3759157,394125,3603631,3561333,3560999,3337127,3330219,3281758,3219400,3185979,3137929,866660,3484437,266398,281985,296020,2747525,4333895,3820501,4313858,322649,3838020,1852910,4948659,3483300,2918822,3500000,401630,783547,3527399,1580835,256899,163506,258192,159116,153996,1972688,834297,431433,458528,412913,292808,113156,3500755,149451,150664,170007,155611,152260,155480,155765,156720,157203,159187,161023,161434,162482,163159,163172,163531,164916,164916,166032,166056,166271,166361,166430,166805,167075,167903,168754,169059,169076,169110,169228,170514,171480,171776,172512,172520,172547,173623,173816,175204,175280,176710,176729,182370,183141,184648,505619,506032,184868,185289,185873,185887,186066,191177,191642,192158,192255,912356,195116,919484,197229,199210,199826,202574,204488,204647,205240,206396,208373,232675,208653,208940,209848,213752,216173,222377,222910,227093,231137,232469,236768,242291,250153,410040,419335,424604,438449,1255359,1162831,1383297,1390405,1398609,1403539,1427980,330841,1523082,2176211,375455,6137767,159691,3734999,591528,554154,593003,1102513,1134969,1296299,1636814,6593495,1802528,1951944,1962695,2484316,2050389,2128560,2208924,2239788,2341982,2432090,2444812,2574960,2636207,2669415,2693344,2693587,2704483,2777168,2828481,2850177,2470461,2933011,2947140,2974387,3000006,3024606,3016226,3043779,3085218,208548,3161324,3295960,3338283,3343092,3395605,2998268,4632975,4000010,3500000,6079100,4117513,5616777,157098,361500,336305,332906,333002,331988,331344,320483,315800,315666,314743,313216,305614,303151,303939,302080,295932,295465,279337,277824,277513,270924,271411,261814,261298,257715,257324,257218,237091,1678634,1733211,1807217,2423300,2794566,3199998,3136410,842167,801683,729863,692650,592189,564198,562897,556575,556841,543010,523270,512887,506032,500690,497965,492222,467137,455271}
  15. mediummaps={273373,263819,225484,357892,3908151,3668866,3333223,2469365,823329,4337732,4107909,4000008,4000007,3860578,3849999,3826546,3815568,3779861,3767893,3747520,3734989,1737800,6462982,3668877,3659983,3576303,1939604,5292798,2601214,3493456,3473704,3471016,3404894,5085011,3292308,4373748,5348692,3200001,3964892,3920916,3750360,294478,298424,305680,353356,346684,3963960,2718406,2797076,2811229,3042080,2817711,4121359,5132197,1568331,4413656,3999979,3939000,4484685,3530999,2758747,4720851,4506542,315283,4794517,4822672,5008365,5505990,4000662,5356911,5758150,3985463,4660408,330827,366260,4632975,3828508,2659411,6575613,2633917,355336,313214,6609034,3999979,3041105,4578236,4697673,195453,5616978,6546598,1952415,6022675,2080400,4362335,3645415,1737914,3118161,1923584,293306,3434941,2474044,2860211,3311534,4093488,4000000,2961800,2719419,2789121,3038589,2920826,4295473,605255,3456260,320607,3295954,600050,150651,152733,157004,158417,160841,3668888,5134116,4067327,557132,163094,172605,179005,185529,189819,192560,203664,214755,216171,2795201,225744,231921,254785,263819,272689,272518,277427,289865,4617716,301610,304861,590775,316012,318129,327354,330967,365061,372255,397469,374995,3133917,424685,424900,2932238,439092,454049,457726,482791,492399,499986,504485,522719,531084,541729,552986,574183,596239,684566,721319,758595,815336,898934,1111252,970919,976944,1004622,1046877,1066607,1130256,1157281,1164086,1242584,536905,1266330,1303323,1323048,1301649,2772507}
  16. hardmaps={4209243,1156092,4224188,3895460,2514792,722837,397478,4051345,3418086,4948551,383358}
  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={"Mcsguigf","Muffwind","M0cinho"}
  26. playertrue={Mcsguigf=true,Muffwind=true,M0cinho=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 == "Muffwind" 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=="Muffwind" 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== "Muffwind" 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