Advertisement
Boeing747-8

Untitled

Aug 9th, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 28.60 KB | None | 0 0
  1. --300,80,150,200
  2. tfm.exec.setGameTime(3,true)
  3. dp={}
  4. roles={0,1}
  5. maps={7489629}
  6. data={}
  7. text={}
  8. lang={}
  9. players={}
  10. ids={
  11. 0,
  12. 0,
  13. 0,
  14. 0
  15. }
  16. alive=0
  17. lang.en={
  18. menu="Menu",
  19. profile2="Profile",
  20. help2="Help",
  21. help="In #kidnapper the goal of the game is for protectors to catch the mouse with the bomb before the mouse gets to the hole. The mouse with the bomb can use attacks to shield off protectors.",
  22. wins="Total Wins",
  23. wins_Bomber="Wins As Kidnapper",
  24. wins_Protector="Wins As Protector",
  25. close="Close",
  26. health=100,
  27. bomber_Wins="Kidnapper Wins!",
  28. protector_Wins="Protectors Win!",
  29. powerups2="Powerups",
  30. powerup1="[Normal Attack]</J> Is activated by pressing space. Only works for Protectors when they are near the bomber.",
  31. powerup2="[Mega Jump]</J> Is activated by the down arrow.",
  32. mouseStolen="kidnapped the mouse!",
  33. buy="Buy",
  34. bought="Equip",
  35. unequip="Unequip",
  36. shop="Shop",
  37. points="Points",
  38. notEnough="Not enough points!"
  39. }
  40. lastKidnapper=""
  41. for _, s in next, {'AutoTimeLeft', 'PhysicalConsumables', 'AfkDeath', 'AutoShaman', 'AutoNewGame'} do
  42. tfm.exec['disable' .. s]()
  43. end
  44. function Dp(name)
  45. name = name:sub(1,1):upper()..name:sub(2):lower()
  46. for i,dp in ipairs(dp) do
  47. if name==dp then
  48. return true
  49. end
  50. end
  51. return false
  52. end
  53. function stolen(n)
  54. data[n].p=player
  55. data[n].stolen="<R>"..data[n].p.."<J> "..text[n].mouseStolen
  56. tfm.exec.chatMessage(data[n].stolen,n)
  57. end
  58. function particles(x,y)
  59. tfm.exec.displayParticle(9,x,y+10,-0.4,0.1,0.2,0.3,nil)
  60. tfm.exec.displayParticle(9,x,y+10,-0.6,0.2,0.6,0.2,nil)
  61. tfm.exec.displayParticle(9,x,y+10,-0.8,0.3,0.8,0.1,nil)
  62. tfm.exec.displayParticle(9,x,y+10,0.4,0.4,-0.4,0.3,nil)
  63. tfm.exec.displayParticle(9,x,y+10,0.6,0.5,-0.6,0.2,nil)
  64. tfm.exec.displayParticle(9,x,y+10,0.8,0.6,-0.8,0.1,nil)
  65. end
  66. function bigJump(n,x,y)
  67. tfm.exec.movePlayer(n,0,0,false,0,-80,true)
  68. tfm.exec.displayParticle(3,x-5,y+10,-0.8,0,0,0,n)
  69. tfm.exec.displayParticle(3,x+5,y+10,0.8,0,0,0,n)
  70. tfm.exec.displayParticle(3,x-10,y+10,-1.7,0,0,0,n)
  71. tfm.exec.displayParticle(3,x+10,y+10,1.7,0,0,0,n)
  72. particles(x,y)
  73. end
  74. function identifyBomber(n)
  75. if data[n].role==0 then
  76. tfm.exec.setNameColor(n,0x00FF00)
  77. tfm.exec.movePlayer(n,1023,432,false,0,50,false)
  78. elseif data[n].role==1 then
  79. tfm.exec.setNameColor(n,0xFF0000)
  80. end
  81. end
  82. function countAlive()
  83. alive=0
  84. for n,player in pairs(tfm.get.room.playerList) do
  85. if tfm.get.room.playerList[n].isDead==false then
  86. alive=alive+1
  87. end
  88. end
  89. end
  90. function removeWinner()
  91. ui.removeTextArea(20,nil)
  92. ui.removeTextArea(30,nil)
  93. ui.removeTextArea(40,nil)
  94. ui.removeTextArea(50,nil)
  95. ui.removeTextArea(60,nil)
  96. ui.removeTextArea(19,nil)
  97. end
  98.  
  99. function win(n)
  100. if tfm.get.room.playerList[n].isDead==false and data[n].role==0 then
  101. data[n].wins=data[n].wins+1
  102. data[n].points=data[n].points+7
  103. data[n].wins_Protector=data[n].wins_Protector+1
  104. end
  105. end
  106. function insertName(n)
  107. table.insert(players,n)
  108. end
  109. function setLang(n)
  110. text[n]=lang[tfm.get.room.playerList[n].community] or lang.en
  111. end
  112. function setData(n)
  113. data[n]=
  114. {
  115. wins=0,
  116. role=0,
  117. health=100,
  118. spawn=1,
  119. wins_Protector=0,
  120. wins_Bomber=0,
  121. p="",
  122. stolen="",
  123. shopItems={propellerMouse=0,greenMouse=0,lightningMouse=0,tigerMouse=0},
  124. buy1=text[n].buy,
  125. buy2=text[n].buy,
  126. buy3=text[n].buy,
  127. buy4=text[n].buy,
  128. using="1651b5bc86d.png",
  129. points=1220
  130. }
  131. end
  132. function chooseRole()
  133. mice=0
  134. for n,player in pairs(tfm.get.room.playerList) do
  135. mice=mice+1
  136. data[n].role=0
  137. end
  138. player=players[math.random(#players)]
  139. while player==lastKidnapper do
  140. player=players[math.random(#players)]
  141. end
  142. lastKidnapper=player
  143. data[player].role=1
  144. player=""..player
  145. end
  146. function bindKeyboard(n)
  147. for i=0,150 do
  148. tfm.exec.bindKeyboard(n,i,true,true)
  149. end
  150. end
  151. function showMenu(n)
  152. ui.addTextArea(0, "<p align='center'><font face='calibri'><a href='event:menu2'>"..text[n].menu, n, 10, 30, 42, 20, 0x000001, 0xFFFFFF, 1, true)
  153. end
  154. function showMenu2(n)
  155. ui.addTextArea(0, "<p align='center'><font face='calibri'><a href='event:Menu'>"..text[n].menu.." </a>| <a href='event:Help'>"..text[n].help2.."</a> | <a href='event:Profile'>"..text[n].profile2.."</a> | <a href='event:Powerups'>"..text[n].powerups2.."</a> | <a href='event:Shop'>"..text[n].shop, n, 10, 30, 210, 20, 0x000001, 0xffffff, 1, true)
  156. end
  157. function removeImage(n)
  158. tfm.exec.removeImage(id1)
  159. tfm.exec.removeImage(id2)
  160. tfm.exec.removeImage(id3)
  161. tfm.exec.removeImage(id4)
  162. end
  163. function removeShop(n)
  164. for i=1020,1050 do
  165. ui.removeTextArea(i,n)
  166. end
  167. end
  168. function showHealth(n)
  169. ui.addTextArea(-3, "", n, 319, 27, 100, 18, 0xffffff, 0xffffff, 1, true)
  170. ui.addTextArea(-1, "", n, 319, 27, data[n].health, 18, 0x1aff00, 0x1aff00, 1, true)
  171. ui.addTextArea(-2, "<p align='center'><b><font color='#000000'>"..data[n].health.."%", n, 345, 27, 54, 18, 0x324650, 0x000000, 0, true)
  172. end
  173. function displayTab(n,info,subject)
  174. ui.addTextArea(2, "", n, 262, 72, 360, 290, 0x331f15, 0x331f15, 1, true)
  175. ui.addTextArea(3, "", n, 262, 125, 4, 180, 0x6b4231, 0x6b4231, 1, true)
  176. ui.addTextArea(5, "", n, 295, 72, 290, 4, 0x6b4231, 0x6b4231, 1, true)
  177. ui.addTextArea(4, "", n, 618, 125, 4, 180, 0x6b4231, 0x6b4231, 1, true)
  178. ui.addTextArea(6, "", n, 295, 358, 295, 4, 0x6b4231, 0x6b4231, 1, true)
  179. ui.addTextArea(1, "<p align='center'><font face='calibri'><font size='17'><b>#KIDNAPPER - "..subject.."</b></font></font><font size='14'>\n\n"..info, n, 271, 80, 342, 270, 0x1b262b, 0x131c21, 1, true)
  180. ui.addTextArea(7, "<p align='center'><font size='13'><a href='event:close'>"..text[n].close.."</a></font>", n, 272, 330, 339, 20, 0x324650, 0x324650, 1, true)
  181. end
  182. function profile(n,info)
  183. ui.addTextArea(2, "", n, 262, 72, 268, 290, 0x331f15, 0x331f15, 1, true)
  184. ui.addTextArea(3, "", n, 262, 120, 4, 180, 0x6b4231, 0x6b4231, 1, true)
  185. ui.addTextArea(5, "", n, 295, 72, 198, 4, 0x6b4231, 0x6b4231, 1, true)
  186. ui.addTextArea(4, "", n, 526, 120, 4, 180, 0x6b4231, 0x6b4231, 1, true)
  187. ui.addTextArea(6, "", n, 295, 358, 198, 4, 0x6b4231, 0x6b4231, 1, true)
  188. ui.addTextArea(1, "<p align='center'><font face='calibri'><font size='17'><b>"..n.."</b></font></font></p><font size='14'>\n<font face='calibri'>\n"..info, n, 270, 82, 252, 270, 0x1b262b, 0x131c21, 1, true)
  189. ui.addTextArea(7, "<p align='center'><font size='13'><a href='event:close'>"..text[n].close.."</a></font>", n, 272, 330, 248, 20, 0x324650, 0x324650, 1, true)
  190. end
  191. function profile2(n,info,l)
  192. ui.addTextArea(2, "", l, 262, 72, 268, 290, 0x331f15, 0x331f15, 1, true)
  193. ui.addTextArea(3, "", l, 262, 120, 4, 180, 0x6b4231, 0x6b4231, 1, true)
  194. ui.addTextArea(5, "", l, 295, 72, 198, 4, 0x6b4231, 0x6b4231, 1, true)
  195. ui.addTextArea(4, "", l, 526, 120, 4, 180, 0x6b4231, 0x6b4231, 1, true)
  196. ui.addTextArea(6, "", l, 295, 358, 198, 4, 0x6b4231, 0x6b4231, 1, true)
  197. ui.addTextArea(1, "<p align='center'><font face='calibri'><font size='17'><b>"..n.."</b></font></font></p><font size='14'>\n<font face='calibri'>\n"..info, l, 270, 82, 252, 270, 0x1b262b, 0x131c21, 1, true)
  198. ui.addTextArea(7, "<p align='center'><font size='13'><a href='event:close'>"..text[l].close.."</a></font>", l, 272, 330, 248, 20, 0x324650, 0x324650, 1, true)
  199. end
  200. function close(n)
  201. for i=1,7 do
  202. ui.removeTextArea(i,n)
  203. end
  204. end
  205. function nearBomber(n,x,y,p)
  206. if ((tfm.get.room.playerList[n].x<tfm.get.room.playerList[p].x+100 and tfm.get.room.playerList[n].x<tfm.get.room.playerList[p].x) and tfm.get.room.playerList[n].y<tfm.get.room.playerList[p].y+50 and tfm.get.room.playerList[n].y>tfm.get.room.playerList[p].y-50) and not (n==p) and data[p].health>0 and tfm.get.room.playerList[n].isFacingRight==true then
  207. tfm.exec.movePlayer(p,0,0,false,operation[math.random(#operation)],operation[math.random(#operation)],true)
  208. data[p].health=data[p].health-12.5
  209. tfm.exec.displayParticle(1,x,y,0.2,0,0.2,0,nil)
  210. tfm.exec.displayParticle(1,x,y,0.4,0,0.4,0,nil)
  211. tfm.exec.displayParticle(1,x,y,0.6,0,0.6,0,nil)
  212. tfm.exec.displayParticle(1,x,y,0.8,0,0.8,0,nil)
  213. tfm.exec.displayParticle(1,x,y,1,0,1,0,nil)
  214. tfm.exec.displayParticle(1,x,y-10,0.2,0,0.2,0,nil)
  215. tfm.exec.displayParticle(1,x,y-10,0.4,0,0.4,0,nil)
  216. tfm.exec.displayParticle(1,x,y-10,0.6,0,0.6,0,nil)
  217. tfm.exec.displayParticle(1,x,y-10,0.8,0,0.8,0,nil)
  218. tfm.exec.displayParticle(1,x,y-10,1,0,1,0,nil)
  219. tfm.exec.displayParticle(1,x,y+10,0.2,0,0.2,0,nil)
  220. tfm.exec.displayParticle(1,x,y+10,0.4,0,0.4,0,nli)
  221. tfm.exec.displayParticle(1,x,y+10,0.6,0,0.6,0,nil)
  222. tfm.exec.displayParticle(1,x,y+10,0.8,0,0.8,0,nil)
  223. tfm.exec.displayParticle(1,x,y+10,1,0,1,0,nil)
  224. end
  225. if ((tfm.get.room.playerList[n].x>tfm.get.room.playerList[p].x-100 and tfm.get.room.playerList[n].x>tfm.get.room.playerList[p].x) and tfm.get.room.playerList[n].y<tfm.get.room.playerList[p].y+50 and tfm.get.room.playerList[n].y>tfm.get.room.playerList[p].y-50) and not (n==p) and data[p].health>0 and tfm.get.room.playerList[n].isFacingRight==false then
  226. tfm.exec.movePlayer(p,0,0,false,operation[math.random(#operation)],operation[math.random(#operation)],true)
  227. data[p].health=data[p].health-12.5
  228. tfm.exec.displayParticle(1,x,y,-0.2,0,-0.2,0,nil)
  229. tfm.exec.displayParticle(1,x,y,-0.4,0,-0.4,0,nil)
  230. tfm.exec.displayParticle(1,x,y,-0.6,0,-0.6,0,nil)
  231. tfm.exec.displayParticle(1,x,y,-0.8,0,-0.8,0,nil)
  232. tfm.exec.displayParticle(1,x,y,-1,0,-1,0,nil)
  233. tfm.exec.displayParticle(1,x,y-10,-0.2,0,-0.2,0,nil)
  234. tfm.exec.displayParticle(1,x,y-10,-0.4,0,-0.4,0,nil)
  235. tfm.exec.displayParticle(1,x,y-10,-0.6,0,-0.6,0,nil)
  236. tfm.exec.displayParticle(1,x,y-10,-0.8,0,-0.8,0,nil)
  237. tfm.exec.displayParticle(1,x,y-10,-1,0,-1,0,nil)
  238. tfm.exec.displayParticle(1,x,y+10,-0.2,0,-0.2,0,nil)
  239. tfm.exec.displayParticle(1,x,y+10,-0.4,0,-0.4,0,nli)
  240. tfm.exec.displayParticle(1,x,y+10,-0.6,0,-0.6,0,nil)
  241. tfm.exec.displayParticle(1,x,y+10,-0.8,0,-0.8,0,nil)
  242. tfm.exec.displayParticle(1,x,y+10,-1,0,-1,0,nil)
  243. end
  244. if data[p].health<1 then
  245. tfm.exec.killPlayer(p)
  246. end
  247. end
  248. operation={-110,110}
  249. function nearProtector(n,p,x,y)
  250. if not (n==p) and data[p].health>0 and data[n].health>0 then
  251. tfm.exec.displayParticle(13,x,y,-0.2,0.1,-0.2,0.1,nil)
  252. tfm.exec.displayParticle(13,x,y,-0.4,0,-0.4,0,nil)
  253. tfm.exec.displayParticle(13,x,y,-0.6,0,-0.6,0,nil)
  254. tfm.exec.displayParticle(3,x,y,-0.8,0,-0.8,0,nil)
  255. tfm.exec.displayParticle(3,x,y,-8,0,-1,0,nil)
  256. tfm.exec.displayParticle(3,x,y-10,-0.2,0.1,-0.2,0.1,nil)
  257. tfm.exec.displayParticle(13,x,y-10,-0.4,0,-0.4,0,nil)
  258. tfm.exec.displayParticle(13,x,y-10,-0.6,0,-0.6,0,nil)
  259. tfm.exec.displayParticle(13,x,y-10,-0.8,0,-0.8,0,nil)
  260. tfm.exec.displayParticle(13,x,y-10,-1,0,-1,0,nil)
  261. tfm.exec.displayParticle(13,x,y+10,-0.2,0.1,-0.2,0.1,nil)
  262. tfm.exec.displayParticle(13,x,y+10,-0.4,0,-0.4,0,nli)
  263. tfm.exec.displayParticle(13,x,y+10,-0.6,0,-0.6,0,nil)
  264. tfm.exec.displayParticle(13,x,y+10,-0.8,-0.1,-0.8,-0.1,nil)
  265. tfm.exec.displayParticle(13,x,y+10,-1,0,-1,0,nil)
  266. tfm.exec.displayParticle(13,x,y,0.2,0,0.2,0,nil)
  267. tfm.exec.displayParticle(13,x,y,0.4,0,0.4,0,nil)
  268. tfm.exec.displayParticle(13,x,y,0.6,0,0.6,0,nil)
  269. tfm.exec.displayParticle(13,x,y,0.8,0,0.8,0,nil)
  270. tfm.exec.displayParticle(13,x,y,1,0,1,0,nil)
  271. tfm.exec.displayParticle(13,x,y-10,0.2,0.1,0.2,0.1,nil)
  272. tfm.exec.displayParticle(13,x,y-10,0.4,0,0.4,0,nil)
  273. tfm.exec.displayParticle(13,x,y-10,0.6,0,0.6,0,nil)
  274. tfm.exec.displayParticle(13,x,y-10,0.8,0,0.8,0,nil)
  275. tfm.exec.displayParticle(13,x,y-10,1,0,1,0,nil)
  276. tfm.exec.displayParticle(13,x,y+10,0.2,0,0.2,0,nil)
  277. tfm.exec.displayParticle(13,x,y+10,0.4,0,0.4,0,nli)
  278. tfm.exec.displayParticle(13,x,y+10,0.6,0,0.6,0,nil)
  279. tfm.exec.displayParticle(3,x,y+10,0.8,0,0.8,0,nil)
  280. tfm.exec.displayParticle(3,x,y+10,8,0,1,0,nil)
  281. end
  282. if (tfm.get.room.playerList[n].x<tfm.get.room.playerList[p].x+70 and tfm.get.room.playerList[n].x>tfm.get.room.playerList[p].x-70 and tfm.get.room.playerList[n].y<tfm.get.room.playerList[p].y+30 and tfm.get.room.playerList[n].y>tfm.get.room.playerList[p].y-30) and not (n==p) and data[p].health>0 and data[n].health>0 then
  283. data[n].health=data[n].health-12.5
  284. tfm.exec.movePlayer(n,0,0,false,operation[math.random(#operation)],operation[math.random(#operation)],true)
  285. end
  286. if data[n].health<1 then
  287. tfm.exec.killPlayer(n)
  288. end
  289. end
  290.  
  291. for n,player in pairs(tfm.get.room.playerList) do
  292. bindKeyboard(n)
  293. setLang(n)
  294. insertName(n)
  295. setData(n)
  296. showMenu(n)
  297. table.insert(dp,n)
  298. end
  299. chooseRole()
  300. for n,player in pairs(tfm.get.room.playerList) do
  301. identifyBomber(n)
  302. end
  303. function allInfo(n)
  304. bindKeyboard(n)
  305. setLang(n)
  306. insertName(n)
  307. setData(n)
  308. showMenu(n)
  309. identifyBomber(n)
  310. table.insert(dp,n)
  311. end
  312. function eventNewGame()
  313. if mice>1
  314. players={}
  315. for n,player in pairs(tfm.get.room.playerList) do
  316. insertName(n)
  317. end
  318. chooseRole()
  319. countAlive()
  320. removeWinner()
  321. for n,player in pairs(tfm.get.room.playerList) do
  322. identifyBomber(n)
  323. data[n].health=100
  324. stolen(n)
  325. end
  326. id=tfm.exec.addImage(data[player].using,"$"..player, -40, -25)
  327. end
  328. function eventTextAreaCallback(txt, n, a)
  329. removeImage(n)
  330. if a=="Menu" then
  331. showMenu(n)
  332. elseif a=="menu2" then
  333. showMenu2(n)
  334. elseif a=="Help" then
  335. displayTab(n,text[n].help,text[n].help2)
  336. elseif a=="close" then
  337. close(n)
  338. removeImage(n)
  339. removeShop(n)
  340. elseif a=="Profile" then
  341. profile(n,text[n].wins..": <J>"..data[n].wins.."\n\n</J>"..text[n].wins_Bomber..": <J>"..data[n].wins_Bomber.."\n\n</J>"..text[n].wins_Protector..": <J>"..data[n].wins_Protector.."</J>\n\n"..text[n].points..": <J>"..data[n].points)
  342. elseif a=="Powerups" then
  343. displayTab(n,"<J>"..text[n].powerup1.."\n\n<J>"..text[n].powerup2,text[n].powerups2)
  344. elseif a=="Shop" then
  345. shop(n)
  346. elseif a=="buy1" and data[n].points>=80 then
  347. data[n].buy1="</a><G><a href='event:unequip1'>"..text[n].unequip
  348. data[n].using="1651ca2b636.png"
  349. data[n].shopItems.propellerMouse=1
  350. data[n].points=data[n].points-80
  351. shop1(n)
  352. elseif a=="buy2" and data[n].points>=150 then
  353. data[n].buy2="</a><G><a href='event:unequip2'>"..text[n].unequip
  354. data[n].using="1651ca29934.png"
  355. data[n].points=data[n].points-150
  356. shop2(n)
  357. elseif a=="buy1" and not (data[n].points>=80) then
  358. tfm.exec.chatMessage("<R>"..text[n].notEnough,n)
  359. elseif a=="buy3" and data[n].points>=200 then
  360. data[n].buy3="</a><G><a href='event:unequip3'>"..text[n].unequip
  361. data[n].using="1651ca27c02.png"
  362. data[n].points=data[n].points-200
  363. shop3(n)
  364. elseif a=="buy2" and not (data[n].points>=300) then
  365. tfm.exec.chatMessage("<R>"..text[n].notEnough,n)
  366. elseif a=="buy4" and data[n].points>=300 then
  367. data[n].buy4="</a><G><a href='event:unequip4'>"..text[n].unequip
  368. data[n].points=data[n].points-300
  369. data[n].using="1651ca26129.png"
  370. shop4(n)
  371. elseif a=="buy3" and not (data[n].points>=200) then
  372. tfm.exec.chatMessage("<R>"..text[n].notEnough,n)
  373. elseif a=="buy4" and not (data[n].points>=150) then
  374. tfm.exec.chatMessage("<R>"..text[n].notEnough,n)
  375. elseif a=="unequip1" then
  376. data[n].using="1651b5bc86d.png"
  377. data[n].buy1="</a><VP><a href='event:equip1'>"..text[n].bought
  378. shop(n)
  379. elseif a=="unequip2" then
  380. data[n].using="1651b5bc86d.png"
  381. data[n].buy2="</a><VP><a href='event:equip2'>"..text[n].bought
  382. shop(n)
  383. elseif a=="unequip3" then
  384. data[n].using="1651b5bc86d.png"
  385. data[n].buy3="</a><VP><a href='event:equip3'>"..text[n].bought
  386. shop(n)
  387. elseif a=="unequip4" then
  388. data[n].using="1651b5bc86d.png"
  389. data[n].buy4="</a><VP><a href='event:equip4'>"..text[n].bought
  390. shop(n)
  391. elseif a=="equip1" then
  392. data[n].using="1651ca2b636.png"
  393. data[n].buy1="</a><G><a href='event:unequip1'>"..text[n].unequip
  394. shop1(n)
  395. elseif a=="equip2" then
  396. data[n].using="1651ca29934.png"
  397. data[n].buy2="</a><G><a href='event:unequip2'>"..text[n].unequip
  398. shop2(n)
  399. elseif a=="equip3" then
  400. data[n].using="1651ca27c02.png"
  401. data[n].buy3="</a><G><a href='event:unequip3'>"..text[n].unequip
  402. shop3(n)
  403. elseif a=="equip4" then
  404. data[n].using="1651ca26129.png"
  405. data[n].buy4="</a><G><a href='event:unequip4'>"..text[n].unequip
  406. shop4(n)
  407. end
  408. end
  409. function eventNewPlayer(n)
  410. if mice<2 then
  411. tfm.exec.newGame(7489132)
  412. end
  413. allInfo(n)
  414. end
  415. function eventLoop(time,timeRemaining)
  416. if mice>1
  417. for n,player in pairs(tfm.get.room.playerList) do
  418. data[n].spawn=data[n].spawn+0.5
  419. showHealth(n)
  420. end
  421. if timeRemaining<=0 then
  422. tfm.exec.newGame(maps[math.random(#maps)])
  423. end
  424. end
  425.  
  426. function eventKeyboard(n, k, d, x, y)
  427. if mice>1 then
  428. if k==32 and data[n].role==0 and data[n].spawn>0 and tfm.get.room.playerList[n].isDead==false then
  429. nearBomber(n,x,y,player)
  430. data[n].spawn=-1
  431. elseif k==32 and data[n].role==1 and data[n].spawn>0 and tfm.get.room.playerList[n].isDead==false then
  432. data[n].spawn=-1.5
  433. player=player
  434. for n in pairs(tfm.get.room.playerList) do
  435. nearProtector(n,player,tfm.get.room.playerList[player].x,tfm.get.room.playerList[player].y)
  436. end
  437. elseif k==3 and data[n].spawn>0 then
  438. data[n].spawn=-2
  439. player=player
  440. bigJump(n,x,y)
  441. elseif k==112 then
  442.  
  443. end
  444. end
  445. end
  446. function eventPlayerDied(n)
  447. for n,player in pairs(tfm.get.room.playerList) do
  448. win(n)
  449. end
  450. countAlive()
  451. data[n].health=0
  452. if data[n].role==1 then
  453. for n,player in pairs(tfm.get.room.playerList) do
  454. ui.addTextArea(20, "", n, 262, 172, 268, 66, 0x331f15, 0x331f15, 1, true)
  455. ui.addTextArea(30, "", n, 262, 191, 4, 26, 0x6b4231, 0x6b4231, 1, true)
  456. ui.addTextArea(50, "", n, 300, 172, 198, 4, 0x6b4231, 0x6b4231, 1, true)
  457. ui.addTextArea(40, "", n, 526, 192, 4, 26, 0x6b4231, 0x6b4231, 1, true)
  458. ui.addTextArea(60, "", n, 300, 234, 198, 4, 0x6b4231, 0x6b4231, 1, true)
  459. ui.addTextArea(19, "<p align='center'><font size='20'><VP>"..text[n].protector_Wins, n, 270, 182, 252, 44, 0x1b262b, 0x131c21, 1, true)
  460. tfm.exec.setGameTime(5,true)
  461. end
  462. end
  463. end
  464.  
  465. function eventMouse(playerName,x,y)
  466. print("<VP>X</VP><N>:</N><J> "..x.."</J><VP> Y</VP><N>:</N><J> "..y)
  467. end
  468. system.bindMouse("Fuzzyfirsdog#0000", true)
  469. function eventPlayerGetCheese(n)
  470. if data[n].role==1 then
  471. data[n].wins=data[n].wins+1
  472. data[n].wins_Bomber=data[n].wins_Bomber+1
  473. data[n].points=data[n].points+10
  474. tfm.exec.setGameTime(10,true)
  475. for n,player in pairs(tfm.get.room.playerList) do
  476. ui.addTextArea(20, "", n, 262, 172, 268, 66, 0x331f15, 0x331f15, 1, true)
  477. ui.addTextArea(30, "", n, 262, 191, 4, 26, 0x6b4231, 0x6b4231, 1, true)
  478. ui.addTextArea(50, "", n, 300, 172, 198, 4, 0x6b4231, 0x6b4231, 1, true)
  479. ui.addTextArea(40, "", n, 526, 192, 4, 26, 0x6b4231, 0x6b4231, 1, true)
  480. ui.addTextArea(60, "", n, 300, 234, 198, 4, 0x6b4231, 0x6b4231, 1, true)
  481. ui.addTextArea(19, "<p align='center'><font size='20'><R>"..text[n].bomber_Wins, n, 270, 182, 252, 44, 0x1b262b, 0x131c21, 1, true)
  482. if not (data[n].role==1) then
  483. tfm.exec.killPlayer(n)
  484. end
  485. end
  486. end
  487. end
  488. system.disableChatCommandDisplay("p",true)
  489. function eventChatCommand(l,c)
  490. if c=="p" then
  491. profile(l,text[l].wins..": <J>"..data[l].wins.."\n\n</J>"..text[l].wins_Bomber..": <J>"..data[l].wins_Bomber.."\n\n</J>"..text[l].wins_Protector..": <J>"..data[l].wins_Protector)
  492. end
  493. if c:sub(0,1)=="p" and Dp(c:sub(3))then
  494. n = c:sub(3,3):upper()..c:sub(4):lower()
  495. profile2(n,text[l].wins..": <J>"..data[n].wins.."\n\n</J>"..text[l].wins_Bomber..": <J>"..data[n].wins_Bomber.."\n\n</J>"..text[l].wins_Protector..": <J>"..data[n].wins_Protector.."</J>\n\n"..text[l].points..": <J>"..data[n].points,l)
  496. end
  497. end
  498. function shop(n)
  499. ui.addTextArea(1020, "", n, 113, 58, 643, 260, 0x331f15, 0x331f15, 1, true)
  500. ui.addTextArea(1021, "", n, 296, 314, 198, 4, 0x6b4231, 0x6b4231, 1, true)
  501. ui.addTextArea(1022, "", n, 113, 111, 4, 151, 0x6b4231, 0x6b4231, 1, true)
  502. ui.addTextArea(1023, "", n, 752, 111, 4, 151, 0x6b4231, 0x6b4231, 1, true)
  503. ui.addTextArea(1024, "", n, 296, 58, 198, 4, 0x6b4231, 0x6b4231, 1, true)
  504. ui.addTextArea(1025, "<p align='center'><font size='20'><VP>", n, 122, 68, 626, 240, 0x1b262b, 0x131c21, 1, true)
  505. ui.addTextArea(1026, "\n\n\n\n\n\n<p align='center'>"..data[n].points.."/300", n, 154, 94, 100, 100, 0x324650, 0x324650, 1, true)
  506. ui.addTextArea(1027, "<p align='center'><b><a href='event:buy1'>"..data[n].buy1, n, 153, 238, 100, 23, 0x324650, 0x12191c, 1, true)
  507. ui.addTextArea(1028, "<p align='center'><b><a href='event:buy2'>"..data[n].buy2, n, 309, 238, 100, 23, 0x324650, 0x12191c, 1, true)
  508. ui.addTextArea(1029, "<p align='center'><b><a href='event:buy3'>"..data[n].buy3, n, 468, 238, 100, 23, 0x324650, 0x12191c, 1, true)
  509. ui.addTextArea(1030, "\n\n\n\n\n\n<p align='center'>"..data[n].points.."/200", n, 617, 94, 100, 100, 0x324650, 0x324650, 1, true)
  510. ui.addTextArea(1031, "<p align='center'><b><a href='event:buy4'>"..data[n].buy4, n, 617, 238, 100, 23, 0x324650, 0x12191c, 1, true)
  511. ui.addTextArea(1032, "<p align='center'><font size='13'><a href='event:close'>"..text[n].close.."</a></font>", n, 125, 285, 620, 20, 0x324650, 0x324650, 1, true)
  512. ui.addTextArea(1033, "\n\n\n\n\n\n<p align='center'>"..data[n].points.."/80", n, 309, 94, 100, 100, 0x324650, 0x324650, 1, true)
  513. ui.addTextArea(1034, "\n\n\n\n\n\n<p align='center'>"..data[n].points.."/150", n, 468, 94, 100, 100, 0x324650, 0x324650, 1, true)
  514. id4=tfm.exec.addImage("1651ca2b636.png", "&1", 153, 115, n)
  515. id3=tfm.exec.addImage("1651ca29934.png", "&2", 312, 110, n)
  516. id2=tfm.exec.addImage("1651ca27c02.png", "&3", 467, 110, n)
  517. id1=tfm.exec.addImage("1651ca26129.png", "&4", 617, 110, n)
  518. end
  519. function shop1(n)
  520. ui.addTextArea(1020, "", n, 113, 58, 643, 260, 0x331f15, 0x331f15, 1, true)
  521. ui.addTextArea(1021, "", n, 296, 314, 198, 4, 0x6b4231, 0x6b4231, 1, true)
  522. ui.addTextArea(1022, "", n, 113, 111, 4, 151, 0x6b4231, 0x6b4231, 1, true)
  523. ui.addTextArea(1023, "", n, 752, 111, 4, 151, 0x6b4231, 0x6b4231, 1, true)
  524. ui.addTextArea(1024, "", n, 296, 58, 198, 4, 0x6b4231, 0x6b4231, 1, true)
  525. ui.addTextArea(1025, "<p align='center'><font size='20'><VP>", n, 122, 68, 626, 240, 0x1b262b, 0x131c21, 1, true)
  526. ui.addTextArea(1026, "\n\n\n\n\n\n<p align='center'>"..data[n].points.."/300", n, 154, 94, 100, 100, 0x324650, 0x324650, 1, true)
  527. ui.addTextArea(1027, "<p align='center'><b><a href='event:buy1'>"..data[n].buy1, n, 153, 238, 100, 23, 0x324650, 0x12191c, 1, true)
  528. ui.addTextArea(1028, "", n, 309, 238, 100, 23, 0x324650, 0x12191c, 1, true)
  529. ui.addTextArea(1029, "", n, 468, 238, 100, 23, 0x324650, 0x12191c, 1, true)
  530. ui.addTextArea(1030, "\n\n\n\n\n\n<p align='center'>"..data[n].points.."/200", n, 617, 94, 100, 100, 0x324650, 0x324650, 1, true)
  531. ui.addTextArea(1031, "", n, 617, 238, 100, 23, 0x324650, 0x12191c, 1, true)
  532. ui.addTextArea(1032, "<p align='center'><font size='13'><a href='event:close'>"..text[n].close.."</a></font>", n, 125, 285, 620, 20, 0x324650, 0x324650, 1, true)
  533. ui.addTextArea(1033, "\n\n\n\n\n\n<p align='center'>"..data[n].points.."/80", n, 309, 94, 100, 100, 0x324650, 0x324650, 1, true)
  534. ui.addTextArea(1034, "\n\n\n\n\n\n<p align='center'>"..data[n].points.."/150", n, 468, 94, 100, 100, 0x324650, 0x324650, 1, true)
  535. id4=tfm.exec.addImage("1651ca2b636.png", "&1", 153, 115, n)
  536. id3=tfm.exec.addImage("1651ca29934.png", "&2", 312, 110, n)
  537. id2=tfm.exec.addImage("1651ca27c02.png", "&3", 467, 110, n)
  538. id1=tfm.exec.addImage("1651ca26129.png", "&4", 617, 110, n)
  539. end
  540. function shop2(n)
  541. ui.addTextArea(1020, "", n, 113, 58, 643, 260, 0x331f15, 0x331f15, 1, true)
  542. ui.addTextArea(1021, "", n, 296, 314, 198, 4, 0x6b4231, 0x6b4231, 1, true)
  543. ui.addTextArea(1022, "", n, 113, 111, 4, 151, 0x6b4231, 0x6b4231, 1, true)
  544. ui.addTextArea(1023, "", n, 752, 111, 4, 151, 0x6b4231, 0x6b4231, 1, true)
  545. ui.addTextArea(1024, "", n, 296, 58, 198, 4, 0x6b4231, 0x6b4231, 1, true)
  546. ui.addTextArea(1025, "<p align='center'><font size='20'><VP>", n, 122, 68, 626, 240, 0x1b262b, 0x131c21, 1, true)
  547. ui.addTextArea(1026, "\n\n\n\n\n\n<p align='center'>"..data[n].points.."/300", n, 154, 94, 100, 100, 0x324650, 0x324650, 1, true)
  548. ui.addTextArea(1027, "", n, 153, 238, 100, 23, 0x324650, 0x12191c, 1, true)
  549. ui.addTextArea(1028, "<p align='center'><b><a href='event:buy2'>"..data[n].buy2, n, 309, 238, 100, 23, 0x324650, 0x12191c, 1, true)
  550. ui.addTextArea(1029, "", n, 468, 238, 100, 23, 0x324650, 0x12191c, 1, true)
  551. ui.addTextArea(1030, "\n\n\n\n\n\n<p align='center'>"..data[n].points.."/200", n, 617, 94, 100, 100, 0x324650, 0x324650, 1, true)
  552. ui.addTextArea(1031, "", n, 617, 238, 100, 23, 0x324650, 0x12191c, 1, true)
  553. ui.addTextArea(1032, "<p align='center'><font size='13'><a href='event:close'>"..text[n].close.."</a></font>", n, 125, 285, 620, 20, 0x324650, 0x324650, 1, true)
  554. ui.addTextArea(1033, "\n\n\n\n\n\n<p align='center'>"..data[n].points.."/80", n, 309, 94, 100, 100, 0x324650, 0x324650, 1, true)
  555. ui.addTextArea(1034, "\n\n\n\n\n\n<p align='center'>"..data[n].points.."/150", n, 468, 94, 100, 100, 0x324650, 0x324650, 1, true)
  556. id4=tfm.exec.addImage("1651ca2b636.png", "&1", 153, 115, n)
  557. id3=tfm.exec.addImage("1651ca29934.png", "&2", 312, 110, n)
  558. id2=tfm.exec.addImage("1651ca27c02.png", "&3", 467, 110, n)
  559. id1=tfm.exec.addImage("1651ca26129.png", "&4", 617, 110, n)
  560. end
  561. function shop3(n)
  562. ui.addTextArea(1020, "", n, 113, 58, 643, 260, 0x331f15, 0x331f15, 1, true)
  563. ui.addTextArea(1021, "", n, 296, 314, 198, 4, 0x6b4231, 0x6b4231, 1, true)
  564. ui.addTextArea(1022, "", n, 113, 111, 4, 151, 0x6b4231, 0x6b4231, 1, true)
  565. ui.addTextArea(1023, "", n, 752, 111, 4, 151, 0x6b4231, 0x6b4231, 1, true)
  566. ui.addTextArea(1024, "", n, 296, 58, 198, 4, 0x6b4231, 0x6b4231, 1, true)
  567. ui.addTextArea(1025, "<p align='center'><font size='20'><VP>", n, 122, 68, 626, 240, 0x1b262b, 0x131c21, 1, true)
  568. ui.addTextArea(1026, "\n\n\n\n\n\n<p align='center'>"..data[n].points.."/300", n, 154, 94, 100, 100, 0x324650, 0x324650, 1, true)
  569. ui.addTextArea(1027, "", n, 153, 238, 100, 23, 0x324650, 0x12191c, 1, true)
  570. ui.addTextArea(1028, "", n, 309, 238, 100, 23, 0x324650, 0x12191c, 1, true)
  571. ui.addTextArea(1029, "<p align='center'><b><a href='event:buy3'>"..data[n].buy3, n, 468, 238, 100, 23, 0x324650, 0x12191c, 1, true)
  572. ui.addTextArea(1030, "\n\n\n\n\n\n<p align='center'>"..data[n].points.."/200", n, 617, 94, 100, 100, 0x324650, 0x324650, 1, true)
  573. ui.addTextArea(1031, "", n, 617, 238, 100, 23, 0x324650, 0x12191c, 1, true)
  574. ui.addTextArea(1032, "<p align='center'><font size='13'><a href='event:close'>"..text[n].close.."</a></font>", n, 125, 285, 620, 20, 0x324650, 0x324650, 1, true)
  575. ui.addTextArea(1033, "\n\n\n\n\n\n<p align='center'>"..data[n].points.."/80", n, 309, 94, 100, 100, 0x324650, 0x324650, 1, true)
  576. ui.addTextArea(1034, "\n\n\n\n\n\n<p align='center'>"..data[n].points.."/150", n, 468, 94, 100, 100, 0x324650, 0x324650, 1, true)
  577. id4=tfm.exec.addImage("1651ca2b636.png", "&1", 153, 115, n)
  578. id3=tfm.exec.addImage("1651ca29934.png", "&2", 312, 110, n)
  579. id2=tfm.exec.addImage("1651ca27c02.png", "&3", 467, 110, n)
  580. id1=tfm.exec.addImage("1651ca26129.png", "&4", 617, 110, n)
  581. end
  582. function shop4(n)
  583. ui.addTextArea(1020, "", n, 113, 58, 643, 260, 0x331f15, 0x331f15, 1, true)
  584. ui.addTextArea(1021, "", n, 296, 314, 198, 4, 0x6b4231, 0x6b4231, 1, true)
  585. ui.addTextArea(1022, "", n, 113, 111, 4, 151, 0x6b4231, 0x6b4231, 1, true)
  586. ui.addTextArea(1023, "", n, 752, 111, 4, 151, 0x6b4231, 0x6b4231, 1, true)
  587. ui.addTextArea(1024, "", n, 296, 58, 198, 4, 0x6b4231, 0x6b4231, 1, true)
  588. ui.addTextArea(1025, "<p align='center'><font size='20'><VP>", n, 122, 68, 626, 240, 0x1b262b, 0x131c21, 1, true)
  589. ui.addTextArea(1026, "\n\n\n\n\n\n<p align='center'>"..data[n].points.."/300", n, 154, 94, 100, 100, 0x324650, 0x324650, 1, true)
  590. ui.addTextArea(1027, "", n, 153, 238, 100, 23, 0x324650, 0x12191c, 1, true)
  591. ui.addTextArea(1028, "", n, 309, 238, 100, 23, 0x324650, 0x12191c, 1, true)
  592. ui.addTextArea(1029, "", n, 468, 238, 100, 23, 0x324650, 0x12191c, 1, true)
  593. ui.addTextArea(1030, "\n\n\n\n\n\n<p align='center'>"..data[n].points.."/200", n, 617, 94, 100, 100, 0x324650, 0x324650, 1, true)
  594. ui.addTextArea(1031, "<p align='center'><b><a href='event:buy4'>"..data[n].buy4, n, 617, 238, 100, 23, 0x324650, 0x12191c, 1, true)
  595. ui.addTextArea(1032, "<p align='center'><font size='13'><a href='event:close'>"..text[n].close.."</a></font>", n, 125, 285, 620, 20, 0x324650, 0x324650, 1, true)
  596. ui.addTextArea(1033, "\n\n\n\n\n\n<p align='center'>"..data[n].points.."/80", n, 309, 94, 100, 100, 0x324650, 0x324650, 1, true)
  597. ui.addTextArea(1034, "\n\n\n\n\n\n<p align='center'>"..data[n].points.."/150", n, 468, 94, 100, 100, 0x324650, 0x324650, 1, true)
  598. id4=tfm.exec.addImage("1651ca2b636.png", "&1", 153, 115, n)
  599. id3=tfm.exec.addImage("1651ca29934.png", "&2", 312, 110, n)
  600. id2=tfm.exec.addImage("1651ca27c02.png", "&3", 467, 110, n)
  601. id1=tfm.exec.addImage("1651ca26129.png", "&4", 617, 110, n)
  602. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement