Advertisement
Boeing747-8

Untitled

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