Boeing747-8

Untitled

Jun 18th, 2018
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 39.37 KB | None | 0 0
  1. dp={}
  2.  
  3. lag=0
  4. Lives2=600
  5. icedMouseCost=400
  6. cakeCost=200
  7. companionCost=800
  8. shamanCannonCost=1000
  9. watermelonCost=500
  10. mechAnvilCost=800
  11. rockCost=400
  12. ultraCannonCost=1000
  13. nyanCost=400
  14. local toDespawn = {}
  15.  
  16. do
  17. local addShamanObject = tfm.exec.addShamanObject
  18. tfm.exec.addShamanObject = function(...)
  19. toDespawn[#toDespawn + 1] = {
  20. addShamanObject(...),
  21. os.time() + 3000
  22. }
  23.  
  24. return toDespawn[#toDespawn][1]
  25. end
  26. end
  27.  
  28. tfm.exec.disableAllShamanSkills(true)
  29. tfm.exec.disableMortCommand(true)
  30. wonCountDown=1
  31.  
  32. scores={0,0,0,0,0,0,0,0}
  33. maps={7455943,7458404}
  34. powery=320
  35. powerx=math.random(1600)
  36.  
  37. mice=0
  38.  
  39.  
  40.  
  41. Down=string.byte("S")
  42.  
  43. tfm.exec.disableAutoShaman(true)
  44. tfm.exec.disableAutoNewGame(true)
  45. tfm.exec.disableAfkDeath(true)
  46.  
  47. tfm.exec.disableAutoShaman(true)
  48. tfm.exec.disableAutoTimeLeft(true)
  49. tfm.exec.disableAutoScore(true)
  50. data={}
  51. text={}
  52. lang={}
  53. lang.en={boughtNyan="<J>You bought nyan cat!",nyanInv="<p align='left'>Nyan Cat <J><a href='event:equipNyan'>[Equip]</a></J>",nyan="Nyan Cat<N> - Nyan cat will appear as your attack object when you are the Death. <VP>Worth %s points.<J><a href='event:buyNyan'> [Buy]",boughtUltraCannon="<J>You bought the ultra cannon!",ultraCannonInv="<p align='left'>Ultra Cannon <J><a href='event:equipUltraCannon'>[Equip]</a></J>",ultraCannon="Ultra Cannon<N> - 2 glowing ultra cannons will appear as your attack object when you are the Death. <VP>Worth %s points.<J><a href='event:buyUltraCannon'> [Buy]",boughtRock="<J>You bought the rock anvil!",rock="Rock Anvil<N> - A rock anvil appear as your attack object when you are the Death. <VP>Worth %s points.<J><a href='event:buyRock'> [Buy]",rockInv="<p align='left'>Rock Anvil <J><a href='event:equipRock'>[Equip]</a></J>",mechAnvilInv="<p align='left'>Mechanical Anvil <J><a href='event:equipMechAnvil'>[Equip]</a></J>",boughtMechAnvil="<J>You bought the mechanical anvil!",watermelonInv="<p align='left'>Watermelon Cannon <J><a href='event:equipWatermelon'>[Equip]</a></J>",boughtWatermelon="<J>You bought the watermelon cannon!",mechAnvil="Mechanical Anvil<N> - 2 mechanical anvils will appear as your attack object when you are the Death. <VP>Worth %s points.<J><a href='event:buyMechAnvil'> [Buy]",watermelon="Watermelon Cannon<N> - A watermelon cannon will appear as your attack object when you are the Death. <VP>Worth %s points.<J><a href='event:buyWatermelon'> [Buy]",boughtShamanCannon="<J>You bought the shaman cannon!",shamanCannonInv="<p align='left'>Shaman Cannon <J><a href='event:equipShamanCannon'>[Equip]</a></J>",shamanCannon="Shaman Cannon<N> - 3 shaman cannons will appear as your attack object when you are the Death. <VP>Worth %s points.<J><a href='event:buyShamanCannon'> [Buy]",equip="Equip",need2People="You need 2 people to play",nowHave2Lives="<J>You now have 2 lives on each round!",boughtIcedMouse="<J>You just bought the cake object!",boughtCake="<J>You just bought the cake object!",boughtCompanion="<J>You just bought the companion crate!",companionInv="<p align='left'>Companion Crate <J><a href='event:equipCompanion'>[Equip]</a></J>",companion="Companion Crate<N> - A companion crate will appear as your attack object when you are the Death. <VP>Worth %s points.<J><a href='event:buyCompanion'> [Buy]",inventory2="Inventory",inventory="<p align='center'><font size='20'>INVENTORY</font><br><br><font size='12'><p align='left'>Default Box <a href='event:equipDefault'><J>[Equip]</J></a>",icedMouseInv="<p align='left'>Iced mouse <J><a href='event:equipIcedMouse'>[Equip]</a></J>",cakeInv="<p align='left'>Cake <J><a href='event:equipCake'>[Equip]</a></J>",shop2="Shop",cake="Cake Object<N> - A cake will appear as your attack object when you are the Death. <VP>Worth %s points.<J><a href='event:buyCake'> [Buy]",icedMouse="Iced Mouse Object<N> - An iced mouse will appear as your attack object when you are the Death. <VP>Worth %s points.<J><a href='event:buyIcedMouse'> [Buy]",lives2="2 Lives<N> - After you die your first time on a round, you'll be given another live once. <VP>Worth %s points. <J><a href='event:buy2Lives'>[Buy]",description="Description",points="Points",winsAsRunner="Wins as runner",winsAsDeath="Wins as death",profile2="Profile",rules="Rules</font></font></u><font size='12'>\n\n• Using tricks to glitch the game is not allowed\n\n• You are not allowed to hack just like in any other game.",rules2="Rules",commands="Powerups\n\n<font size='11'>Click - Spawns a random shaman object when you have the role of being a <J>Death</J>.\n\nSpacebar - Makes a large jump followed with an invisible cannon when you have the role of being a <J>Runner</J>. \n\nDown Arrow / S key - Gives you a boost of speed. (Works for both Deaths and Runners)",commands2="Powerups",credits="Credits</font></font><font face='verdana'><font size='11'>\n\n<N>Programming - Fuzzyfirsdog#0000\n\nModule Idea - Reddeathnick#3204\n\nArabic Translations - Bodykudo#0000\n\nPowerup Suggestions - Reddeathnick#3204, Seaqueen2003#000, Mugiwaraloffy#9866\n\nFinding Ways To Remove Hacks - Mariluiss#0000 \n\n<VP>Thank you ^^",credits2="Credits",youCanAttack="<R>Death: <N>You can attack",youCanNotAttack="<R>Death: <N>You can not attack",youCanUsePowerups="<VP>Runner: <N>You can use powerups",youCanNotUsePowerups="<VP>Runner: <N>You can not use powerups",attacked="ATTACKED",youAreARunner="You are a runner",youAreADeath="You are a death",help="In #deathrun there are <J>Deaths</J> and <J>Runners</J>. Deaths should try to kill the mice by clicking to spawn objects, if no runners get into the hole then deaths win! Runners are supposed to use the powerups they are given to get into the hole and escape Deaths. If one runner gets into the hole, runners win.",close="Close",help2="Help",superJump="SUPER JUMP",speed="SPEED",deathsWin="Deaths win!",runnersWin="Runners win!"}
  54. lang.ar={
  55. equip="ارتداء",
  56. need2People="أنت تحتاج لاعبيّن لكي تلعب",
  57. nowHave2Lives="<J>أنت الآن لديك حيواتان كل جولة",
  58. boughtIcedMouse="<J>لقد اشتريت الفأر المجمَد!",
  59. boughtCake="<J>لقد اشتريت صندوق الكعك!",
  60. boughtCompanion="<J>لقد اشتريت القفص!",
  61. companionInv="<p align='left'>القفص <J><a href='event:equipCompanion'>[ارتداء]</a></J>",
  62. companion="القفص<N> - القفص سوف يظهر كهجومك عندما تكون القاتل.<VP>يستحق %s نقطة.<J><a href='event:buyCompanion'> [شراء]",
  63. inventory2="المخزن",
  64. inventory="<p align='center'><font size='20'>المخزن</font><br><br><font size='12'><p align='left'>الصندوق العادي <a href='event:equipDefault'><J>[ارتداء]</J></a>",
  65. icedMouseInv="<p align='left'>الفأر المجمَد <J><a href='event:equipIcedMouse'>[ارتداء]</a></J>",
  66. cakeInv="<p align='left'>الكعكة <J><a href='event:equipCake'>[ارتداء]</a></J>",
  67. shop2="المتجر",
  68. cake="الكعكة<N> - الكعكة سوف تظهر كهجومك عندما تكون القاتل.<VP>تستحق %s نقطة.<J><a href='event:buyCake'> [شراء]",
  69. icedMouse="الفأر المجمَد<N> - الفأر المجمَد سوف يظهر كهجومك عندما تكون القاتل. <VP>يستحق %s نقطة.<J><a href='event:buyIcedMouse'> [شراء]",
  70. lives2="حياتان<N> - بعدما تموت لأول مرة في الجولة, سوف يتم إعطائك حياة أخرى فورًا. <VP>تستحق %s نقطة. <J><a href='event:buy2Lives'>[شراء]",
  71. description="الوصف",
  72. points="نقاط",
  73. winsAsRunner="مرات الفوز كراكض",
  74. winsAsDeath="مرات الفوز كقاتل",
  75. profile2="الملف الشخصي",
  76. rules="القواعد</font></font></u><font size='12'>\n\n• استخدام طرق لتخريب اللعبة ليس مسموحًا\n\n• ليس مسموحًا لك استخدام الهكر كباقي الألعاب.",
  77. rules2="القواعد",
  78. commands="المقويات\n\n<font size='11'>اضغط - Sلكي تطلق صندوقًا للهجوم عندما تكون <J>القاتل</J>.\n\nالمسافة - تجعلك تقفز طويلًا بالإضافة إلى قذيفة مخفية عندما تكون <J>راكضًا</J>. \n\nزر أسفل / زر S - تعطيك سرعة إضافية. (تعمل لدى القاتل والراكضين)",
  79. commands2="المقويِات",
  80. credits="ائتمان</font></font><font face='verdana'><font size='11'>\n\n<N>البرمجة - Fuzzyfirsdog#0000\n\n الترجمة العربية - Bodykudo#0000\n\nفكرة النمط - Reddeathnick#3204\n\nاقتراح المقويِّات - Reddeathnick#3204, Seaqueen2003#000, Mugiwaraloffy#9866\n\nإيجاد طريق لمنع الهكرز - Mariluiss#0000 \n\n<VP>شكرًا لكم ^^",
  81. credits2="الائتمان",
  82. youCanAttack="<R>القاتل: <N>يمكنك الهجوم",
  83. youCanNotAttack="<R>القاتل: <N>لا يمكنك الهجوم",
  84. youCanUsePowerups="<VP>الراكض: <N>يمكنك استعمال المقويِّات",
  85. youCanNotUsePowerups="<VP>الراكض: <N>لا يمكنك استعمال المقويِّات",
  86. attacked="هجم",
  87. youAreARunner="أنت راكض",
  88. youAreADeath="أنت قاتل",
  89. help="في #deathrun يوجد <J>قاتلين</J> و <J>الراكضين</J>. القاتلين يجب أن يحاولوا قتل الراكضين عبر إطلاق أدوات عبر الضغط على الشاشة, إذا لم يفز أي راكض سيفوز القاتل! الراكضين يمكنهم استعمال المقويِّات. إذا وصل راكض واحد للجحر, يفوز الراكضين.",
  90. close="إغلاق",
  91. help2="المساعدة",
  92. superJump="القفزة الخارقة",
  93. speed="السرعة",
  94. deathsWin="فاز القاتل!",
  95. runnersWin="فاز الراكضين!"
  96. }
  97.  
  98. roles={"Death","Runner"}
  99.  
  100.  
  101. death=0
  102. runner=0
  103. miceInHole=0
  104.  
  105. function setLang(n)
  106.  
  107. text[n]=lang[tfm.get.room.playerList[n].community] or lang.en
  108.  
  109. end
  110.  
  111.  
  112. function bindMouse()
  113. for n,player in pairs(tfm.get.room.playerList) do
  114.  
  115. tfm.exec.bindKeyboard(n, 0, true, true)
  116.  
  117. tfm.exec.bindKeyboard(n, 1, true, true)
  118.  
  119. tfm.exec.bindKeyboard(n, 2, true, true)
  120.  
  121. tfm.exec.bindKeyboard(n, 3, true, true)
  122.  
  123. tfm.exec.bindKeyboard(n, 32, true, true)
  124.  
  125. system.bindMouse(n,true)
  126. end
  127. end
  128. bindMouse()
  129.  
  130. tfm.exec.newGame(maps[math.random(#maps)])
  131. names={}
  132.  
  133. theRole=1
  134. currentRole=roles[math.floor(theRole)]
  135.  
  136. function changeCurrentRole()
  137.  
  138. end
  139. numbs={1,2}
  140.  
  141. function showTabs(n)
  142. ui.addTextArea(130, "", n, -432, -802, 3625, 953, 0xff0000, 0x00a2ff, 0.6, true)
  143.  
  144. ui.addTextArea(15, "<VP><a href='event:help'><font size='12'>"..text[n].help2.."</a> | <a href='event:credits'>"..text[n].credits2.." </a>|<a href='event:commands'> "..text[n].commands2.." </a>|<a href='event:rules'> "..text[n].rules2, n, 10, 30, 264, 26, 0x00aaff, 0x00eeff, 0, true)
  145. ui.addTextArea(155, "<font size='12'><VP><a href='event:inventory'>"..text[n].inventory2.."</a> | <a href='event:shop'>"..text[n].shop2.." | <a href='event:profile'>"..text[n].profile2, n, 630, 30, 264, 26, 0x00aaff, 0x00eeff, 0, true)
  146.  
  147. end
  148. function setData(n)
  149. data[n]=
  150. {
  151. nyan=false,
  152. ultraCannon=false,
  153. rock=false,
  154. mechAnvil=false,
  155. watermelon=false,
  156. shamanCannon=false,
  157. companion=false,
  158. isInRoom=true,
  159. cake=false,
  160. objects=2,
  161. lives2=false,
  162. normalLives=1,
  163. lives=1,
  164. icedMouse=false,
  165. winsAsRunner=0,
  166. winsAsDeath=0,
  167. facingx=85,
  168. name=n,
  169. role="Runner",
  170. points=9000,
  171. spawnLimit=-1,
  172. ableToShoot=0,
  173. ableToShoot2=0,
  174. pointsAndScore="",
  175. inventory=text[n].inventory
  176. }
  177. end
  178. function inventory(n)
  179. ui.addTextArea(152, "", n, 510, 96, 286, 290, 0x00ff6a, 0x047529, 1, true)
  180. ui.addTextArea(92, "<p align='center'><font size='20'>"..text[n].inventory.."</font>\n", n, 515, 101, 276, 279, 0x034511, 0x005219, 1, true)
  181. ui.addTextArea(222, "<p align='center'><font size='13'><a href='event:close'><font color='#808080'>"..text[n].close, n, 515, 343, 276, 36, 0x034511, 0x005219, 1, true)
  182.  
  183. end
  184. for n,player in pairs(tfm.get.room.playerList) do
  185. setLang(n)
  186. changeCurrentRole()
  187. mice=mice+1
  188. table.insert(names,n)
  189.  
  190. showTabs(n)
  191. setData(n)
  192.  
  193.  
  194.  
  195.  
  196. data[n].pointsAndScore=data[n].name.." "..data[n].points
  197. table.insert(scores,data[n].points)
  198. showTabs(n)
  199. tfm.exec.lowerSyncDelay(n)
  200. table.insert(dp,n)
  201. end
  202.  
  203. function Dp(name)
  204. name = name:sub(1,1):upper()..name:sub(2):lower()
  205. for i,dp in ipairs(dp) do
  206. if name==dp then
  207. return true
  208. end
  209. end
  210. return false
  211. end
  212.  
  213. function shopPage1(n)
  214. ui.addTextArea(18, "", n, 494, 117, 282, 178, 0x59442c, 0x59442c, 1, true)
  215. ui.addTextArea(25, "<CE>"..string.format(text[n].lives2,Lives2), n, 500, 123, 270, 46, 0x302315, 0x59442c, 1, true)
  216. ui.addTextArea(19, "<CE>"..string.format(text[n].icedMouse,icedMouseCost), n, 500, 182, 270, 46, 0x302315, 0x59442c, 1, true)
  217. ui.addTextArea(110, "<CE>"..string.format(text[n].cake,cakeCost), n, 500, 241, 270, 47, 0x302315, 0x59442c, 1, true)
  218. ui.addTextArea(222, "<p align='center'><font size='13'><a href='event:close'><font color='#808080'>"..text[n].close, n, 494, 296, 282, 36, 0x59442c, 0x59442c, 1, true)
  219. ui.addTextArea(92, "<G>«", n, 498, 310, 19, 18, 0x324650, 0x000000, 1, true)
  220. ui.addTextArea(152, "<a href='event:nextTo2'>»", n, 752, 310, 19, 18, 0x324650, 0x000000, 1, true)
  221.  
  222.  
  223. end
  224.  
  225. function shopPage2(n)
  226. ui.addTextArea(18, "", n, 494, 117, 282, 178, 0x59442c, 0x59442c, 1, true)
  227. ui.addTextArea(25, "<CE>"..string.format(text[n].companion,companionCost), n, 500, 123, 270, 46, 0x302315, 0x59442c, 1, true)
  228. ui.addTextArea(19, "<CE>"..string.format(text[n].shamanCannon,shamanCannonCost), n, 500, 182, 270, 46, 0x302315, 0x59442c, 1, true)
  229. ui.addTextArea(110, "<CE>"..string.format(text[n].watermelon,watermelonCost), n, 500, 241, 270, 47, 0x302315, 0x59442c, 1, true)
  230. ui.addTextArea(222, "<p align='center'><font size='13'><a href='event:close'><font color='#808080'>"..text[n].close, n, 494, 296, 282, 36, 0x59442c, 0x59442c, 1, true)
  231. ui.addTextArea(92, "<a href='event:backTo1'>«", n, 498, 310, 19, 18, 0x324650, 0x000000, 1, true)
  232. ui.addTextArea(152, "<a href='event:nextTo3'>»", n, 752, 310, 19, 18, 0x324650, 0x000000, 1, true)
  233.  
  234.  
  235. end
  236.  
  237.  
  238. function shopPage3(n)
  239. ui.addTextArea(18, "", n, 494, 117, 282, 178, 0x59442c, 0x59442c, 1, true)
  240. ui.addTextArea(25, "<CE>"..string.format(text[n].mechAnvil,mechAnvilCost), n, 500, 123, 270, 46, 0x302315, 0x59442c, 1, true)
  241. ui.addTextArea(19, "<CE>"..string.format(text[n].rock,rockCost), n, 500, 182, 270, 46, 0x302315, 0x59442c, 1, true)
  242. ui.addTextArea(110, "<CE>"..string.format(text[n].ultraCannon,ultraCannonCost), n, 500, 241, 270, 47, 0x302315, 0x59442c, 1, true)
  243. ui.addTextArea(222, "<p align='center'><font size='13'><a href='event:close'><font color='#808080'>"..text[n].close, n, 494, 296, 282, 36, 0x59442c, 0x59442c, 1, true)
  244. ui.addTextArea(92, "<a href='event:backTo2'>«", n, 498, 310, 19, 18, 0x324650, 0x000000, 1, true)
  245. ui.addTextArea(152, "<a href='event:nextTo4'>»", n, 752, 310, 19, 18, 0x324650, 0x000000, 1, true)
  246.  
  247.  
  248. end
  249.  
  250. function shopPage4(n)
  251. ui.addTextArea(18, "", n, 494, 117, 282, 178, 0x59442c, 0x59442c, 1, true)
  252. ui.addTextArea(25, "<CE>"..string.format(text[n].nyan,nyanCost), n, 500, 123, 270, 46, 0x302315, 0x59442c, 1, true)
  253. ui.addTextArea(19, "<CE>", n, 500, 182, 270, 46, 0x302315, 0x59442c, 1, true)
  254. ui.addTextArea(110, "<CE>", n, 500, 241, 270, 47, 0x302315, 0x59442c, 1, true)
  255. ui.addTextArea(222, "<p align='center'><font size='13'><a href='event:close'><font color='#808080'>"..text[n].close, n, 494, 296, 282, 36, 0x59442c, 0x59442c, 1, true)
  256. ui.addTextArea(92, "<a href='event:backTo3'>«", n, 498, 310, 19, 18, 0x324650, 0x000000, 1, true)
  257. ui.addTextArea(152, "<G>»", n, 752, 310, 19, 18, 0x324650, 0x000000, 1, true)
  258.  
  259.  
  260. end
  261.  
  262.  
  263. n1=scores[math.floor(1)]
  264. n2=scores[math.floor(2)]
  265. n3=scores[math.floor(3)]
  266. print(n1)
  267. print(n2)
  268. print(n3)
  269.  
  270. function findRoles(n)
  271. for n,player in pairs(tfm.get.room.playerList) do
  272. if data[n].role=="Death" then
  273.  
  274. tfm.exec.movePlayer(n,150,30,false,0,0,false)
  275.  
  276. elseif data[n].role=="Runner" then
  277.  
  278. tfm.exec.movePlayer(n,70,300,false,0,0,false)
  279.  
  280. end
  281. end
  282. end
  283.  
  284. function findRolesNewPlayer(n)
  285. if data[n].role=="Death" then
  286. tfm.exec.movePlayer(n,150,30,false,0,0,false)
  287.  
  288. elseif data[n].role=="Runner" then
  289.  
  290. tfm.exec.movePlayer(n,70,300,false,0,0,false)
  291.  
  292.  
  293.  
  294. end
  295. end
  296.  
  297.  
  298.  
  299. a={}
  300.  
  301. function eventNewPlayer(n)
  302. setLang(n)
  303. print("yooy")
  304. bindMouse()
  305.  
  306. mice=mice+1
  307. if not data[n] then
  308. table.insert(dp,n)
  309. setData(n)
  310. end
  311. data[n].isInRoom=true
  312.  
  313. showTabs(n)
  314. table.insert(names,n)
  315. findRolesNewPlayer(n)
  316. tfm.exec.respawnPlayer(n)
  317. end
  318.  
  319.  
  320.  
  321.  
  322.  
  323. function addToRoleNumber()
  324. for n,player in pairs(tfm.get.room.playerList) do
  325. if data[n].role=="Death" then
  326. death=death+1
  327. end
  328. if data[n].role=="Runner" then
  329. runner=runner+1
  330.  
  331.  
  332. end
  333. findRoles(n)
  334.  
  335.  
  336. end
  337. end
  338.  
  339.  
  340.  
  341. tfm.exec.newGame(maps[math.random(#maps)])
  342. amountInA=0
  343.  
  344. function punishGlitchers()
  345. if a then
  346. for i=1,amountInA do
  347. data[a[math.floor(amountInA)]].role="Runner"
  348. end
  349. end
  350. end
  351.  
  352. randomDeath=names[math.floor(math.random(mice))]
  353. data[randomDeath].role="Death"
  354. lastDeath=""
  355. function eventNewGame()
  356. lag=0
  357.  
  358.  
  359. local toDespawn = {}
  360.  
  361. do
  362. local addShamanObject = tfm.exec.addShamanObject
  363. tfm.exec.addShamanObject = function(...)
  364. toDespawn[#toDespawn + 1] = {
  365. addShamanObject(...),
  366. os.time() + 3000
  367. }
  368.  
  369. return toDespawn[#toDespawn][1]
  370. end
  371. end
  372. time=0
  373. theRole=1
  374. powerx=math.random(1600)
  375. runner=0
  376. death=0
  377. mice=0
  378. for n,player in pairs(tfm.get.room.playerList) do
  379. data[n].lives=data[n].normalLives
  380. mice=mice+1
  381. changeCurrentRole()
  382. data[n].role="Runner"
  383. data[n].ableToShoot=0
  384. data[n].ableToShoot2=0
  385. data[n].spawnLimit=-1
  386.  
  387. end
  388. mice=mice
  389. if lastDeath==randomDeath then
  390. randomDeath=names[math.random(math.floor(mice))]
  391. end
  392.  
  393. if data[randomDeath].isInRoom==true then
  394. data[randomDeath].role="Death"
  395. elseif data[randomDeath].isInRoom==false then
  396. randomDeath=names[math.random(math.floor(mice))]
  397. end
  398.  
  399. lastDeath=randomDeath
  400.  
  401. addToRoleNumber()
  402. findRoles(n)
  403. print("Last death: "..lastDeath)
  404. end
  405.  
  406.  
  407.  
  408.  
  409.  
  410.  
  411.  
  412. locationx=0
  413. locationy=0
  414.  
  415.  
  416. objects={54}
  417.  
  418. function eventMouse(n,x,y)
  419.  
  420.  
  421.  
  422. if data[n].role=="Death" and (math.floor(time)>3) and lag<2 and data[n].spawnLimit<1 and mice>1 then
  423. lag=lag+1
  424. if lag>3 then
  425. randomDeath=names[math.floor(math.random(mice))]
  426. data[randomDeath].role="Death"
  427. local toDespawn = {}
  428. table.insert(a,n)
  429. amountInA=amountInA+1
  430. do
  431. local addShamanObject = tfm.exec.addShamanObject
  432. tfm.exec.addShamanObject = function(...)
  433. toDespawn[#toDespawn + 1] = {
  434. addShamanObject(...),
  435. os.time() + 0000
  436. }
  437.  
  438. return toDespawn[#toDespawn][1]
  439. end
  440. end
  441.  
  442.  
  443. ui.addTextArea(133, "<R><font size='17'><b>USING LAG TRICKS OR HACKS ARE NOT ALLOWED IN THIS ROOM", n, 143, 150, 534, 91, 0x324650, 0x000000, 1, true)
  444. time=-0.5
  445.  
  446. tfm.exec.newGame(maps[math.random(#maps)])
  447. eventNewGame()
  448. end
  449.  
  450.  
  451. data[n].spawnLimit=3
  452. attacked=0
  453. attacked=n
  454. for n,player in pairs(tfm.get.room.playerList) do
  455. ui.addTextArea(2, "<font color='#FF9000'><font size='30'><b>"..attacked.." "..text[n].attacked, n, x, y, 425, 100, 0x324650, 0x000000, 0, false)
  456. end
  457. locationx=x
  458. locationy=y
  459.  
  460.  
  461. if not (data[n].objects==1704) and not (data[n].objects==1002) and not (data[n].objects==1706) and not (data[n].objects==1709) then
  462. tfm.exec.addShamanObject(data[n].objects,locationx,locationy,0,0,20,false)
  463. end
  464. if data[n].objects==1704 then
  465. tfm.exec.addShamanObject(data[n].objects,locationx,locationy,180,0,20,false)
  466.  
  467. tfm.exec.addShamanObject(data[n].objects,locationx-20,locationy,180,0,20,false)
  468. tfm.exec.addShamanObject(data[n].objects,locationx+20,locationy,180,0,20,false)
  469. elseif data[n].objects==1706 then
  470. tfm.exec.addShamanObject(data[n].objects,locationx,locationy,180,0,20,false)
  471. elseif data[n].objects==1709 then
  472. tfm.exec.addShamanObject(data[n].objects,locationx+5,locationy,160,10,120,false)
  473. tfm.exec.addShamanObject(data[n].objects,locationx-5,locationy,-160,10,20,false)
  474. elseif data[n].objects==1002 then
  475. tfm.exec.addShamanObject(data[n].objects,locationx-5,locationy,180,0,20,false)
  476. tfm.exec.addShamanObject(data[n].objects,locationx+5,locationy,180,0,20,false)
  477. end
  478. tfm.exec.displayParticle(0,locationx,locationy,0.5,0.5,0.5,0.5,nil)
  479. tfm.exec.displayParticle(0,locationx,locationy,-0.5,-0.5,-0.5,-0.5,nil)
  480. tfm.exec.displayParticle(2,locationx,locationy,3,-3,3,-3,nil)
  481. tfm.exec.displayParticle(2,locationx,locationy,-3,3,-3,3,nil)
  482.  
  483. tfm.exec.displayParticle(0,locationx,locationy,-0.5,0.5,-0.5,0.5,nil)
  484.  
  485. tfm.exec.displayParticle(0,locationx,locationy,0.5,-0.5,0.5,-0.5,nil)
  486. tfm.exec.displayParticle(2,locationx,locationy,1,-3,1,-3,nil)
  487. tfm.exec.displayParticle(2,locationx,locationy,1,1,3,1,nil)
  488. tfm.exec.displayParticle(2,locationx,locationy,-1,3,-1,3,nil)
  489. tfm.exec.displayParticle(2,locationx,locationy,-1,-1,-3,-1,nil)
  490. tfm.exec.displayParticle(5,locationx,locationy,0.5,0.5,0.5,0.5,nil)
  491. tfm.exec.displayParticle(5,locationx,locationy,-0.5,-0.5,-0.5,-0.5,nil)
  492.  
  493. tfm.exec.displayParticle(5,locationx,locationy,-0.5,0.5,-0.5,0.5,nil)
  494. tfm.exec.displayParticle(5,locationx,locationy,0.5,-0.5,0.5,-0.5,nil)
  495.  
  496. canShoot()
  497. end
  498.  
  499. end
  500.  
  501.  
  502. time=0
  503.  
  504. number1=0
  505. number2=0
  506. number3=0
  507.  
  508.  
  509. function eventPlayerGetCheese(n)
  510. randomDeath=n
  511. print(n)
  512. if data[n].role=="Runner" and mice>1 then
  513.  
  514. tfm.exec.chatMessage(text[n].runnersWin,n)
  515. time=119.5
  516. data[n].points=data[n].points+15
  517.  
  518. for n,player in pairs(tfm.get.room.playerList) do
  519. if data[n].role=="Runner" then
  520. data[n].points=data[n].points+5
  521. data[n].winsAsRunner=data[n].winsAsRunner+1
  522. wonCountDown=-5
  523. end
  524. table.insert(scores,data[n].points)
  525. ui.addTextArea(133, "<b><font size='40'><font color='#0ff164'>"..text[n].runnersWin, n, 296, 282, 351, 189, 0xd41717, 0x000000, 0, true)
  526.  
  527.  
  528.  
  529. end
  530. end
  531.  
  532.  
  533. function eventPlayerWon(n)
  534. print("yo")
  535. randomDeath=n
  536. if data[n].role=="Death" then
  537. time=117
  538. end
  539.  
  540. for n,player in pairs(tfm.get.room.playerList) do
  541. ui.addTextArea(133, "<b><font size='40'><font color='#d40000'>"..text[n].deathsWin, n, 296, 282, 351, 189, 0xd41717, 0x000000, 0, true)
  542. tfm.exec.chatMessage(text[n].deathsWin,n)
  543. if data[n].role=="Death" then
  544. data[n].winsAsDeath=data[n].winsAsDeath+1
  545. data[n].points=data[n].points+10
  546. end
  547. randomDeath=names[math.floor(math.random(mice))]
  548. end
  549.  
  550.  
  551.  
  552.  
  553. tfm.exec.newGame(maps[math.random(#maps)])
  554. print("Runners win!")
  555. end
  556. end
  557.  
  558.  
  559.  
  560. function explosions()
  561. tfm.exec.displayParticle(0,locationx,locationy,0.5,0.5,0.5,0.5,nil)
  562. tfm.exec.displayParticle(0,locationx,locationy,-0.5,-0.5,-0.5,-0.5,nil)
  563. tfm.exec.displayParticle(2,locationx,locationy,3,-3,3,-3,nil)
  564. tfm.exec.displayParticle(2,locationx,locationy,-3,3,-3,3,nil)
  565.  
  566. tfm.exec.displayParticle(0,locationx,locationy,-0.5,0.5,-0.5,0.5,nil)
  567. tfm.exec.displayParticle(0,locationx,locationy,0.5,-0.5,0.5,-0.5,nil)
  568. tfm.exec.displayParticle(2,locationx,locationy,1,-3,1,-3,nil)
  569. tfm.exec.displayParticle(2,locationx,locationy,1,1,3,1,nil)
  570. tfm.exec.displayParticle(2,locationx,locationy,-1,3,-1,3,nil)
  571. tfm.exec.displayParticle(2,locationx,locationy,-1,-1,-3,-1,nil)
  572. tfm.exec.displayParticle(5,locationx,locationy,0.5,0.5,0.5,0.5,nil)
  573. tfm.exec.displayParticle(5,locationx,locationy,-0.5,-0.5,-0.5,-0.5,nil)
  574.  
  575. tfm.exec.displayParticle(5,locationx,locationy,-0.5,0.5,-0.5,0.5,nil)
  576. tfm.exec.displayParticle(5,locationx,locationy,0.5,-0.5,0.5,-0.5,nil)
  577. tfm.exec.explosion(locationx, locationy, 40, 40, false)
  578. end
  579.  
  580.  
  581. function canShoot()
  582. for n,player in pairs(tfm.get.room.playerList) do
  583. if data[n].spawnLimit<1 and data[n].role=="Death" then
  584. ui.addTextArea(12, "\n<p align='center'>"..text[n].youCanAttack, n, 270, 23, 240, 36, 0x00a611, 0x338500, 0.6, true)
  585.  
  586. end
  587. if not (data[n].spawnLimit<1) and data[n].role=="Death" then
  588. ui.addTextArea(12, "\n<p align='center'>"..text[n].youCanNotAttack, n, 270, 23, 240, 36, 0x802c2c, 0x6e0000, 0.6, true)
  589.  
  590. end
  591. if data[n].spawnLimit<1 and data[n].role=="Runner" then
  592. ui.addTextArea(12, "\n<p align='center'>"..text[n].youCanUsePowerups, n, 270, 23, 240, 36, 0x00a611, 0x338500, 0.6, true)
  593.  
  594. end
  595. if not (data[n].spawnLimit<1) and data[n].role=="Runner" then
  596. ui.addTextArea(12, "\n<p align='center'>"..text[n].youCanNotUsePowerups, n, 270, 23, 240, 36, 0x802c2c, 0x6e0000, 0.6, true)
  597.  
  598. end
  599. end
  600. end
  601.  
  602. function removeObjectAfterTime()
  603. for k, v in ipairs(toDespawn) do
  604. if os.time() > v[2] then
  605. tfm.exec.removeObject(v[1])
  606. table.remove(toDespawn, k)
  607. end
  608. end
  609. end
  610.  
  611. function eventLoop()
  612.  
  613. lag=0
  614. removeObjectAfterTime()
  615. if mice<2 then
  616. for n,player in pairs(tfm.get.room.playerList) do
  617. ui.addTextArea(202, "<p align='center'><R><b><font size='20'>"..text[n].need2People, n, 137, 166, 471, 122, 0x404040, 0x000000, 1, true)
  618. end
  619. elseif mice>1 then
  620. ui.removeTextArea(202,nil)
  621.  
  622. wonCoundown=wonCountDown+0.5
  623. ui.addTextArea(13, "<font size='20'>"..math.floor(time).." / 120s", nil, 316, 73, 251, 32, 0x324650, 0x000000, 0, true)
  624.  
  625.  
  626. canShoot()
  627. for n,player in pairs(tfm.get.room.playerList) do
  628.  
  629. data[n].spawnLimit=data[n].spawnLimit-0.5
  630.  
  631. if tfm.get.room.playerList[n].y>100 and data[n].role=="Death" then
  632.  
  633. tfm.exec.movePlayer(n,150,30,false,0,0,false)
  634.  
  635. elseif tfm.get.room.playerList[n].y<100 and data[n].role=="Runner" then
  636. tfm.exec.movePlayer(n,70,300,false,0,0,false)
  637. elseif tfm.get.room.playerList[n].x>600 and time<5 then
  638. tfm.exec.killPlayer(n)
  639. tfm.exec.movePlayer(n,150,tfm.get.room.playerList[n].y,false,0,0,false)
  640. tfm.exec.respawnPlayer(n)
  641. end
  642.  
  643.  
  644.  
  645.  
  646. if data[n].spawnLimit==0 then
  647. ui.removeTextArea(2,nil)
  648. system.bindMouse(n, true)
  649. ui.removeTextArea(11,n)
  650. end
  651. end
  652. time=time+.5
  653. if time==120 then
  654. tfm.exec.newGame(maps[math.random(#maps)])
  655. print("Deaths win!")
  656. time=-0.5
  657. elseif time==0 then
  658. for n,player in pairs(tfm.get.room.playerList) do
  659. findRoles(n)
  660. end
  661. elseif time==5 then
  662. for n,player in pairs(tfm.get.room.playerList) do
  663. ui.removeTextArea(0,nil)
  664. ui.removeTextArea(2,nil)
  665. system.bindMouse(n, true)
  666. ui.removeTextArea(133,n)
  667.  
  668. end
  669. end
  670. end
  671. end
  672.  
  673.  
  674.  
  675.  
  676. function eventKeyboard(n, key, down, x,y)
  677.  
  678. --FACING
  679.  
  680. if key==0 then
  681. data[n].facing=-85
  682. end
  683. if key==2 then
  684. data[n].facing=85
  685. print(-data[n].facing)
  686. end
  687. if time>3 and mice>1 then
  688.  
  689. --AUTOMATIC POWERUPS
  690.  
  691. if key==32 and data[n].role=="Runner" and data[n].spawnLimit<0 then
  692. ui.addTextArea(11, "<b><font size='30'><font color='#F0F000'>"..text[n].superJump, n, x-50, y-50, 379, 67, 0x324650, 0x000000, 0, false)
  693.  
  694. tfm.exec.displayParticle(0,x,y,0.5,0.5,0.5,0.5,nil)
  695. tfm.exec.displayParticle(0,locationx,locationy,-0.5,-0.5,-0.5,-0.5,nil)
  696. tfm.exec.displayParticle(2,locationx,locationy,3,-3,3,-3,nil)
  697. tfm.exec.displayParticle(2,locationx,locationy,-3,3,-3,3,nil)
  698.  
  699. tfm.exec.displayParticle(0,x,y,-0.5,0.5,-0.5,0.5,nil)
  700. tfm.exec.displayParticle(0,x,y,0.5,-0.5,0.5,-0.5,nil)
  701. tfm.exec.displayParticle(2,x,y,1,-3,1,-3,nil)
  702. tfm.exec.displayParticle(2,x,y,1,1,3,1,nil)
  703. tfm.exec.displayParticle(2,x,y,-1,3,-1,3,nil)
  704. tfm.exec.displayParticle(2,x,y,-1,-1,-3,-1,nil)
  705. tfm.exec.displayParticle(5,x,y,0.5,0.5,0.5,0.5,nil)
  706. tfm.exec.displayParticle(5,x,y,-0.5,-0.5,-0.5,-0.5,nil)
  707.  
  708. tfm.exec.displayParticle(5,x,y,-0.5,0.5,-0.5,0.5,nil)
  709. tfm.exec.displayParticle(5,x,y,0.5,-0.5,0.5,-0.5,nil)
  710. tfm.exec.movePlayer(n,x,y,false,0,-80,false)
  711.  
  712.  
  713.  
  714.  
  715. tfm.exec.displayParticle(0,x,y,0.5,0.5,0.5,0.5,nil)
  716. tfm.exec.displayParticle(0,x,locationy,-0.5,-0.5,-0.5,-0.5,nil)
  717. tfm.exec.displayParticle(10,x,y,3,-3,3,-3,nil)
  718. tfm.exec.displayParticle(10,x,y,-3,3,-3,3,nil)
  719.  
  720. tfm.exec.displayParticle(10,x,y,-0.5,0.5,-0.5,0.5,nil)
  721. tfm.exec.displayParticle(10,x,y,0.5,-0.5,0.5,-0.5,nil)
  722. tfm.exec.displayParticle(2,x,y,1,-3,1,-3,nil)
  723. tfm.exec.displayParticle(10,x,y,1,1,3,1,nil)
  724. tfm.exec.displayParticle(12,x,y,-1,3,-1,3,nil)
  725. tfm.exec.displayParticle(12,x,y,-1,-1,-3,-1,nil)
  726. tfm.exec.displayParticle(5,x,y,0.5,0.5,0.5,0.5,nil)
  727. tfm.exec.displayParticle(5,x,y,-0.5,-0.5,-0.5,-0.5,nil)
  728.  
  729. tfm.exec.displayParticle(5,x,y,-0.5,0.5,-0.5,0.5,nil)
  730. tfm.exec.displayParticle(5,x,y,0.5,-0.5,0.5,-0.5,nil)
  731.  
  732. tfm.exec.bindKeyboard(n, 32, false, false)
  733. tfm.exec.addShamanObject(17,x,y,60,50,-10,true)
  734. data[n].spawnLimit=3.5
  735. data[n].ableToShoot=0
  736. canShoot()
  737. elseif (key==3) and data[n].spawnLimit<0 then
  738.  
  739. ui.addTextArea(11, "<b><font size='30'><font color='#F0F000'>"..text[n].speed, n, x-50, y-50, 379, 67, 0x324650, 0x000000, 0, false)
  740.  
  741. tfm.exec.displayParticle(0,x,y,0.5,0.5,0.5,0.5,nil)
  742. tfm.exec.displayParticle(0,x,y,-0.5,-0.5,-0.5,-0.5,nil)
  743. tfm.exec.displayParticle(2,x,y,3,-3,3,-3,nil)
  744. tfm.exec.displayParticle(2,x,y,-3,3,-3,3,nil)
  745.  
  746. tfm.exec.displayParticle(0,x,y,-0.5,0.5,-0.5,0.5,nil)
  747. tfm.exec.displayParticle(0,x,y,0.5,-0.5,0.5,-0.5,nil)
  748. tfm.exec.displayParticle(2,x,y,1,-3,1,-3,nil)
  749. tfm.exec.displayParticle(2,x,y,1,1,3,1,nil)
  750. tfm.exec.displayParticle(2,x,y,-1,3,-1,3,nil)
  751. tfm.exec.displayParticle(2,x,y,-1,-1,-3,-1,nil)
  752. tfm.exec.displayParticle(5,x,y,0.5,0.5,0.5,0.5,nil)
  753. tfm.exec.displayParticle(5,x,y,-0.5,-0.5,-0.5,-0.5,nil)
  754.  
  755. tfm.exec.displayParticle(5,x,y,-0.5,0.5,-0.5,0.5,nil)
  756. tfm.exec.displayParticle(5,x,y,0.5,-0.5,0.5,-0.5,nil)
  757. tfm.exec.movePlayer(n,x,y,false,data[n].facing,0,true)
  758.  
  759.  
  760.  
  761.  
  762. tfm.exec.displayParticle(0,x,y,0.5,0.5,0.5,0.5,nil)
  763. tfm.exec.displayParticle(0,locationx,locationy,-0.5,-0.5,-0.5,-0.5,nil)
  764. tfm.exec.displayParticle(10,locationx,locationy,3,-3,3,-3,nil)
  765. tfm.exec.displayParticle(10,locationx,locationy,-3,3,-3,3,nil)
  766.  
  767. tfm.exec.displayParticle(10,x,y,-0.5,0.5,-0.5,0.5,nil)
  768. tfm.exec.displayParticle(10,x,y,0.5,-0.5,0.5,-0.5,nil)
  769. tfm.exec.displayParticle(2,x,y,1,-3,1,-3,nil)
  770. tfm.exec.displayParticle(10,x,y,1,1,3,1,nil)
  771. tfm.exec.displayParticle(12,x,y,-1,3,-1,3,nil)
  772. tfm.exec.displayParticle(12,x,y,-1,-1,-3,-1,nil)
  773. tfm.exec.displayParticle(5,x,y,0.5,0.5,0.5,0.5,nil)
  774. tfm.exec.displayParticle(5,x,y,-0.5,-0.5,-0.5,-0.5,nil)
  775.  
  776. tfm.exec.displayParticle(5,x,y,-0.5,0.5,-0.5,0.5,nil)
  777. tfm.exec.displayParticle(5,x,y,0.5,-0.5,0.5,-0.5,nil)
  778.  
  779.  
  780.  
  781. data[n].spawnLimit=3.5
  782. data[n].ableToShoot=0
  783. canShoot()
  784.  
  785. end
  786. end
  787. end
  788.  
  789. function removeTextAreas(n)
  790. ui.removeTextArea(18,n)
  791. ui.removeTextArea(19,n)
  792. ui.removeTextArea(110,n)
  793. ui.removeTextArea(222,n)
  794. ui.removeTextArea(25,n)
  795. ui.removeTextArea(152,n)
  796. ui.removeTextArea(92,n)
  797. end
  798. n=0
  799. function eventTextAreaCallback(id,p,a)
  800. n=p
  801. if a=="close" then
  802. removeTextAreas(n)
  803. elseif a=="help" then
  804. removeTextAreas(n)
  805. --TABS
  806.  
  807. ui.addTextArea(110, "", n, 498, 165, 266, 217, 0x324650, 0x000000, 1, true)
  808. ui.addTextArea(18, "<font size='14'><font face='calibri'>"..text[n].help, n, 504, 172, 254, 179, 0x000000, 0x000000, 1, true)
  809. ui.addTextArea(19, "<p align='center'><font size='13'><a href='event:close'>"..text[n].close, n, 504, 338, 254, 36, 0x000000, 0xffffff, 1, true)
  810. elseif a=="credits" then
  811. removeTextAreas(n)
  812. ui.addTextArea(18, "<p align='center'><font size='16'><font face='verdana'><J>"..text[n].credits, n, 504, 142, 254, 194, 0x4f4132, 0x695743, 1, true)
  813. ui.addTextArea(19, "<p align='center'><font size='13'><a href='event:close'>"..text[n].close, n, 504, 343, 254, 36, 0x4f4132, 0x30291a, 1, true)
  814. elseif a=="commands" then
  815. removeTextAreas(n)
  816. ui.addTextArea(18, "<p align='center'><font size='14'><font face='verdana'>"..text[n].commands, n, 545, 111, 220, 238, 0x50498c, 0x05014f, 1, true)
  817. ui.addTextArea(19, "<p align='center'><font size='13'><a href='event:close'>"..text[n].close, n, 545, 346, 220, 36, 0x284391, 0x0f0759, 1, true)
  818. elseif a=="rules" then
  819. removeTextAreas(n)
  820. ui.addTextArea(18, "<p align='center'><u><font size='17'><font face='calibri'>"..text[n].rules, n, 562, 132, 201, 230, 0xab0000, 0xff4545, 1, true)
  821. ui.addTextArea(19, "<p align='center'><font size='13'><a href='event:close'>"..text[n].close, n, 562, 329, 201, 36, 0xa60000, 0xff0000, 1, true)
  822. elseif a=="profile" then
  823. removeTextAreas(n)
  824. ui.addTextArea(110, "<p align='center'><font size='12'><font color='#000000'><font face='calibri'>"..n, n, 551, 89, 233, 278, 0xffd900, 0x075214, 1, true)
  825. ui.addTextArea(18, "<p align='left'><font size='13'><font face='calibri'><font color='#FFFFFF'>"..text[n].points..": <br>"..data[n].points.." <br><br>"..text[n].winsAsDeath..": <br>"..data[n].winsAsDeath.."<br><br>"..text[n].winsAsRunner..": <br>"..data[n].winsAsRunner, n, 557, 136, 105, 226, 0x966a03, 0x294d12, 1, true)
  826. ui.addTextArea(19, "<p align='left'><font size='13'><font face='calibri'><font color='#FFFFFF'>"..text[n].description, n, 675, 136, 104, 226, 0x966a03, 0x294d12, 1, true)
  827. ui.addTextArea(25, "<p align='center'><font size='13'><a href='event:close'><font color='#505050'>"..text[n].close, n, 551, 368, 233, 36, 0xffd900, 0x075214, 1, true)
  828. end
  829. if a=="inventory" then
  830. removeTextAreas(n)
  831. ui.addTextArea(152, "", n, 510, 96, 286, 290, 0x00ff6a, 0x047529, 1, true)
  832. ui.addTextArea(92, "<p align='center'><font size='20'>"..data[n].inventory, n, 515, 101, 276, 279, 0x034511, 0x005219, 1, true)
  833. ui.addTextArea(222, "<p align='center'><font size='13'><a href='event:close'><font color='#808080'>"..text[n].close, n, 515, 343, 276, 36, 0x034511, 0x005219, 1, true)
  834. end
  835.  
  836. if a=="equipDefault" then
  837. data[n].objects=2
  838. elseif a=="equipNyan" then
  839. data[n].objects=212
  840. elseif a=="equipUltraCannon" then
  841. data[n].objects=1709
  842. elseif a=="equipCompanion" then
  843. data[n].objects=61
  844. elseif a=="equipShamanCannon" then
  845. data[n].objects=1704
  846. elseif a=="equipWatermelon" then
  847. data[n].objects=1706
  848. elseif a=="equipIcedMouse" then
  849. data[n].objects=54
  850. elseif a=="equipCake" then
  851. data[n].objects=207
  852. elseif a=="equipMechAnvil" then
  853. data[n].objects=1002
  854. elseif a=="equipRock" then
  855. data[n].objects=1003
  856.  
  857. elseif a=="shop" then
  858. shopPage1(n)
  859. elseif a=="backTo1" then
  860. shopPage1(n)
  861. elseif a=="nextTo2" then
  862.  
  863. shopPage2(n)
  864. elseif a=="backTo2" then
  865. shopPage2(n)
  866. elseif a=="nextTo3" then
  867. shopPage3(n)
  868. elseif a=="backTo3" then
  869. shopPage3(n)
  870. elseif a=="nextTo4" then
  871. shopPage4(n)
  872. end
  873. --SHOP ITEMS
  874.  
  875. if a=="buyIcedMouse" and (data[n].points>icedMouseCost or data[n].points==icedMouseCost) and data[n].icedMouse==false then
  876. data[n].inventory = data[n].inventory.."\n"..text[n].icedMouseInv
  877. data[n].objects=54
  878. tfm.exec.chatMessage(text[n].boughtIcedMouse,n)
  879.  
  880. data[n].icedMouse=true
  881. data[n].points=data[n].points-icedMouseCost
  882. elseif a=="buyNyan" and (data[n].points>nyanCost or data[n].points==nyanCost) and data[n].nyan==false then
  883. data[n].inventory = data[n].inventory.."\n"..text[n].nyanInv
  884. data[n].objects=212
  885. tfm.exec.chatMessage(text[n].boughtNyan,n)
  886.  
  887. data[n].nyan=true
  888. data[n].points=data[n].points-nyanCost
  889.  
  890. elseif a=="buyUltraCannon" and (data[n].points>ultraCannonCost or data[n].points==ultraCannonCost) and data[n].ultraCannon==false then
  891. data[n].inventory = data[n].inventory.."\n"..text[n].ultraCannonInv
  892. data[n].objects=1709
  893. tfm.exec.chatMessage(text[n].boughtUltraCannon,n)
  894.  
  895. data[n].ultraCannon=true
  896. data[n].points=data[n].points-ultraCannonCost
  897. elseif a=="buyCake" and (data[n].points>cakeCost or data[n].points==cakeCost) and data[n].cake==false then
  898. data[n].inventory=data[n].inventory.."\n"..text[n].cakeInv
  899.  
  900. data[n].objects=207
  901. tfm.exec.chatMessage(text[n].boughtCake,n)
  902. data[n].cake=true
  903. data[n].points=data[n].points-cakeCost
  904. elseif a=="buyMechAnvil" and (data[n].points>mechAnvilCost or data[n].points==mechAnvilCost) and data[n].mechAnvil==false then
  905. data[n].inventory=data[n].inventory.."\n"..text[n].mechAnvilInv
  906.  
  907. data[n].objects=1002
  908. tfm.exec.chatMessage(text[n].boughtMechAnvil,n)
  909. data[n].mechAnvil=true
  910. data[n].points=data[n].points-mechAnvilCost
  911. elseif a=="buyRock" and (data[n].points>rockCost or data[n].points==rockCost) and data[n].rock==false then
  912. data[n].inventory=data[n].inventory.."\n"..text[n].rockInv
  913.  
  914. data[n].objects=1003
  915. tfm.exec.chatMessage(text[n].boughtRock,n)
  916. data[n].rock=true
  917. data[n].points=data[n].points-rockCost
  918.  
  919. elseif a=="buy2Lives" and (data[n].points>Lives2 or data[n].points==Lives2) and data[n].lives2==false then
  920. data[n].normalLives=2
  921. tfm.exec.chatMessage(text[n].nowHave2Lives,n)
  922. print(data[n].lives)
  923. data[n].points=data[n].points-Lives2
  924. data[n].lives2=true
  925. elseif a=="buyCompanion" and (data[n].points>companionCost or data[n].points==companionCost) and data[n].companion==false then
  926. data[n].objects=61
  927. data[n].inventory = data[n].inventory.."\n"..text[n].companionInv
  928. data[n].companion=true
  929.  
  930. data[n].points=data[n].points-companionCost
  931. tfm.exec.chatMessage(text[n].boughtCompanion,n)
  932. elseif a=="buyShamanCannon" and (data[n].points>shamanCannonCost or data[n].points==shamanCannonCost) and data[n].shamanCannon==false then
  933. data[n].objects=1704
  934. data[n].inventory = data[n].inventory.."\n"..text[n].shamanCannonInv
  935. data[n].shamanCannon=true
  936.  
  937. data[n].points=data[n].points-shamanCannonCost
  938. tfm.exec.chatMessage(text[n].boughtshamanCannon,n)
  939. elseif a=="buyWatermelon" and (data[n].points>watermelonCost or data[n].points==watermelonCost) and data[n].watermelon==false then
  940. data[n].objects=1706
  941. data[n].inventory = data[n].inventory.."\n"..text[n].watermelonInv
  942. data[n].watermelon=true
  943.  
  944. data[n].points=data[n].points-watermelonCost
  945. tfm.exec.chatMessage(text[n].boughtWatermelon,n)
  946.  
  947. end
  948. end
  949.  
  950. function eventPlayerDied(n)
  951. data[n].lives=data[n].lives-1
  952. if data[n].role=="Runner" and data[n].lives==1 then
  953. tfm.exec.respawnPlayer(n)
  954. end
  955. if data[n].role=="Runner" and data[n].lives==0 then
  956. runner=runner-1
  957. print(runner)
  958.  
  959. end
  960. if runner<1 and mice>1 then
  961. tfm.exec.newGame(maps[math.random(#maps)])
  962. for n,player in pairs(tfm.get.room.playerList) do
  963. ui.addTextArea(133, "<b><font size='40'><font color='#d40000'>"..text[n].deathsWin, n, 296, 282, 351, 189, 0xd41717, 0x000000, 0, true)
  964. tfm.exec.chatMessage(text[n].deathsWin,n)
  965. if data[n].role=="Death" then
  966. data[n].points=data[n].points+10
  967. data[n].winsAsDeath=data[n].winsAsDeath+1
  968. end
  969. end
  970. wonCountDown=-5
  971. print("hi")
  972. end
  973. if death<1 then
  974. tfm.exec.newGame(maps[math.random(#maps)])
  975. tfm.exec.disableAutoShaman(true)
  976.  
  977. time=0
  978.  
  979.  
  980. for n,player in pairs(tfm.get.room.playerList) do
  981.  
  982.  
  983. wonCountdown=-5
  984. changeCurrentRole()
  985. data[n].role="Runner"
  986. end
  987. data[names[math.floor(math.random(mice))]].role="Death"
  988. end
  989. end
  990.  
  991.  
  992.  
  993.  
  994. print(death)
  995. print(runner)
  996.  
  997. print(mice)
  998.  
  999. function eventPlayerLeft(n)
  1000. names={}
  1001. for n in pairs(tfm.get.room.playerList) do
  1002. table.insert(names,n)
  1003. end
  1004.  
  1005. data[n].isInRoom=false
  1006. mice=mice-1
  1007. if n==randomDeath then
  1008. randomDeath=names[math.random(math.floor(mice))]
  1009. end
  1010. if data[n].role=="Runner" then
  1011. runner=runner-1
  1012. elseif data[n].role=="Death" then
  1013. death=death-1
  1014. end
  1015. end
  1016.  
  1017.  
  1018.  
  1019.  
  1020. for n,player in pairs(tfm.get.room.playerList) do
  1021. data[n].pointsAndScore=data[n].points.." "..data[n].name
  1022. end
  1023.  
  1024. function eventSummoningEnd(n,id,x,y,angle,t)
  1025. print(id)
  1026. tfm.exec.removeObject(t.id)
  1027. end
  1028.  
  1029. system.disableChatCommandDisplay("profil",true)
  1030. function eventChatCommand(n, c)
  1031. if c:sub(0,7)=="profile" and Dp(c:sub(9)) then
  1032. l = c:sub(9,9):upper()..c:sub(10):lower()
  1033.  
  1034. removeTextAreas(n)
  1035. ui.addTextArea(110, "<p align='center'><font size='12'><font color='#000000'><font face='calibri'>"..l, n, 551, 89, 233, 278, 0xffd900, 0x075214, 1, true)
  1036. ui.addTextArea(18, "<p align='left'><font size='13'><font face='calibri'><font color='#FFFFFF'>"..text[n].points..": <br>"..data[l].points.." <br><br>"..text[n].winsAsDeath..": <br>"..data[l].winsAsDeath.."<br><br>"..text[n].winsAsRunner..": <br>"..data[l].winsAsRunner, n, 557, 136, 105, 226, 0x966a03, 0x294d12, 1, true)
  1037. ui.addTextArea(19, "<p align='left'><font size='13'><font face='calibri'><font color='#FFFFFF'>"..text[n].description, n, 675, 136, 104, 226, 0x966a03, 0x294d12, 1, true)
  1038. ui.addTextArea(25, "<p align='center'><font size='13'><a href='event:close'><font color='#505050'>"..text[n].close, n, 551, 368, 233, 36, 0xffd900, 0x075214, 1, true)
  1039.  
  1040. end
  1041. end
Advertisement
Add Comment
Please, Sign In to add comment