Advertisement
mmmm123m

Untitled

Jan 22nd, 2017
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 25.10 KB | None | 0 0
  1.  
  2. data={}
  3. vampire = {}
  4. vampires = {}
  5. dataname = {}
  6. mice=0
  7. t=0
  8.  
  9. tfm.exec.disableAutoShaman(true);
  10. tfm.exec.disableAutoNewGame(true);
  11. maps = {352381,355957,501711,611320,425030,2796001,198715,332210,391831,208162,299971,2726034,356722,744038,2176620,6438169,241295,4747722,444490,244699,475151,350251,2089069,5067265,283715,2076632,6572872,470687,3854268,406982,407294,4148332}
  12. --maps = {6726048,2439792,1617965,953868,1675985,1387919,2491484,1048633,2374713,4922898}
  13. --maps = {6878399}
  14.  
  15. PV = {7,8,9,10,11,13}
  16. tfm.exec.chatMessage("<j>VampEscape!!")
  17. system.disableChatCommandDisplay("give", true)
  18.  
  19. function Vampire(name)
  20. for i,vampire in ipairs(vampire) do
  21. if name==vampire then
  22. return true
  23. end
  24. end
  25. return false
  26. end
  27. function Vampires(name)
  28. for i,vampires in ipairs(vampires) do
  29. if name==vampires then
  30. return true
  31. end
  32. end
  33. return false
  34. end
  35. function Dataname(name)
  36. for i,dataname in ipairs(dataname) do
  37. if name==dataname then
  38. return true
  39. end
  40. end
  41. return false
  42. end
  43.  
  44. function addData(name)
  45. data[name]={won=0
  46. ,kill=0,vamp=0,lang=tfm.get.room.playerList[name].community,
  47. PV=0---فلوس
  48. ,item="",spirit="false",speed="false",acrobat="false",skill="false"}
  49. end
  50.  
  51. function eventNewPlayer(name)
  52. mice=mice+1
  53. players = {};
  54. for p,_ in pairs (tfm.get.room.playerList) do
  55. table.insert(players,name);
  56. end
  57. if Dataname(name) then else
  58. addData(name)
  59. table.insert(dataname,name)
  60. end
  61. if data[name].lang == "ar" then
  62. tfm.exec.chatMessage("<j>!!VampEscape اهلا بك في",name)
  63. else
  64. tfm.exec.chatMessage("<j>Welcome to VampEscape!!",name)
  65. end
  66. end
  67.  
  68.  
  69. for name,player in pairs(tfm.get.room.playerList) do
  70. mice=mice+1
  71. addData(name)
  72. table.insert(dataname,name)
  73. end
  74.  
  75. function eventKeyboard(name, key, down, x, y)
  76. if key == 32 then
  77. if Vampire(name) then
  78. if vampFly then
  79. tfm.exec.movePlayer(name,0,0,false,0,-50,false)
  80. end
  81. end
  82. elseif key == 70 then
  83. if data[name].skill == "true" then
  84. if data[name].item == "spirit" then
  85. tfm.exec.displayParticle(12,x,y+30)
  86. tfm.exec.movePlayer(name,0,0,true,0,-100,false)
  87. data[name].skill = "false"
  88. elseif data[name].item == "speed" then
  89. if tfm.get.room.playerList[name].isFacingRight then
  90. tfm.exec.displayParticle(26,x+20,y)
  91. tfm.exec.displayParticle(26,x+30,y)
  92. tfm.exec.displayParticle(26,x+40,y)
  93. tfm.exec.displayParticle(26,x+50,y)
  94. tfm.exec.movePlayer(name,0,0,true,100,0,false)
  95. data[name].skill = "false"
  96. else
  97. tfm.exec.displayParticle(26,x-20,y)
  98. tfm.exec.displayParticle(26,x-30,y)
  99. tfm.exec.displayParticle(26,x-40,y)
  100. tfm.exec.displayParticle(26,x-50,y)
  101. tfm.exec.movePlayer(name,0,0,true,-100,0,false)
  102. data[name].skill = "false"
  103. end
  104. elseif data[name].item == "acrobat" then
  105. if tfm.get.room.playerList[name].isFacingRight then
  106. tfm.exec.displayParticle(35,x+20,y,0,0,0,0)
  107. tfm.exec.movePlayer(name,x+65,0)
  108. data[name].skill = "false"
  109. else
  110. tfm.exec.displayParticle(35,x-20,y,0,0,0,0)
  111. tfm.exec.movePlayer(name,x-65,0)
  112. data[name].skill = "false"
  113. end
  114. end
  115. else
  116. if data[name].lang == "ar" then
  117. tfm.exec.chatMessage("<r>يمكنك استخدام هذه الاداة فقط مرة واحدة في كل جولة",name)
  118. else
  119. tfm.exec.chatMessage("<r>You can use this tool one time for every round",name)
  120. end
  121. end
  122. end
  123. end
  124.  
  125. removeshopp = function (name,id)
  126. ui.removeTextArea(9 ..id.. 3621,name);
  127. ui.removeTextArea(9 ..id.. 3622,name);
  128. ui.removeTextArea(9 ..id.. 3623,name);
  129. ui.removeTextArea(9 ..id.. 3624,name);
  130. ui.removeTextArea(9 ..id.. 3625,name);
  131. ui.removeTextArea(9 ..id.. 3626,name);
  132. ui.removeTextArea(9 ..id.. 3627,name);
  133. ui.removeTextArea(9 ..id.. 3628,name);
  134. ui.removeTextArea(9 ..id.. 3629,name);
  135. ui.removeTextArea(9 ..id.. 3630,name);
  136. ui.removeTextArea(9 ..id.. 3631,name);
  137. end
  138.  
  139. twf = {
  140. ui = {
  141.  
  142. popups = {},
  143.  
  144. createPopup = function (id, title,tt, text, player, buttons, closable,shopbt,textbt, x, y, w, h, alpha, U)
  145. if tt== true then
  146. tt=" _______________________<br>"
  147. end
  148. if tt== false then
  149. tt=""
  150. end
  151. ui.addTextArea(9 ..id.. 36 .. 21, "",player,x+-2,y+18,w+24,h+14,0x2E221B,0x2E221B,alpha,true);
  152. ui.addTextArea(9 ..id.. 36 .. 22, "",player,x+-1,y+19,w+22,h+12,0x986742,0x986742,alpha,true);
  153. ui.addTextArea(9 ..id.. 36 .. 23, "",player,x+2,y+22,w+16,h+6,0x171311,0x171311,alpha,true);
  154. ui.addTextArea(9 ..id.. 36 .. 24, "",player,x+3,y+23,w+14,h+4,0x0C191C,0x0C191C,alpha,true);
  155. ui.addTextArea(9 ..id.. 36 .. 25, "",player,x+4,y+24,w+12,h+2,0x24474D,0x24474D,alpha,true);
  156. ui.addTextArea(9 ..id.. 36 .. 26, "",player,x+5,y+25,w+10,h+0,0x183337,0x183337,alpha,true);
  157. ui.addTextArea(9 ..id.. 36 .. 27, "<p align='center'><font size='15' face='verdana'><V><b>"..title.."</b></p></font><R>"..tt.."<p align='left'><font size='12' /><N>\n"..text,player,x+6,y+26,w+8,h+-2,0x122528,0x122528,alpha,true);
  158.  
  159. if closable then
  160. ui.addTextArea(9 ..id.. 36 .. 28, "",player,x+15,y+h-20+25,w-10,15,0x5D7D90,0x5D7D90,alpha,true);
  161. ui.addTextArea(9 ..id.. 36 .. 29, "",player,x+15,y+h-20+27,w-10,15,0x11171C,0x11171C,alpha,true);
  162. ui.addTextArea(9 ..id.. 36 .. 30, "<p align='center'><a href='event:closeTWFPopup_".. 9 ..id.. 36 .."'><N>Close</a>", player,x+15,y+h-20+26,w-10,15,0x3C5064,0x3C5064,alpha,true);
  163.  
  164. end;
  165.  
  166. if shopbt then
  167. ui.addTextArea(9 ..id.. 36 .. 28, "",player,x+15,y+h-20+25,w-10,15,0x5D7D90,0x5D7D90,alpha,true);
  168. ui.addTextArea(9 ..id.. 36 .. 29, "",player,x+15,y+h-20+27,w-10,15,0x11171C,0x11171C,alpha,true);
  169. ui.addTextArea(9 ..id.. 36 .. 30, "<p align='center'>"..textbt.."", player,x+15,y+h-20+26,w-10,15,0x3C5064,0x3C5064,alpha,true);
  170.  
  171. end;
  172.  
  173.  
  174. twf.ui.popups[tostring("9"..id.."36")] = 9 ..id.. 36;
  175.  
  176. end,
  177.  
  178. removePopup = function (id, player) -- Define the var as a function.
  179. ui.removeTextArea(twf.ui.popups[id] .. 21, player);
  180. ui.removeTextArea(twf.ui.popups[id] .. 22, player);
  181. ui.removeTextArea(twf.ui.popups[id] .. 23, player);
  182. ui.removeTextArea(twf.ui.popups[id] .. 24, player);
  183. ui.removeTextArea(twf.ui.popups[id] .. 25, player);
  184. ui.removeTextArea(twf.ui.popups[id] .. 26, player);
  185. ui.removeTextArea(twf.ui.popups[id] .. 27, player);
  186. ui.removeTextArea(twf.ui.popups[id] .. 28, player);
  187. ui.removeTextArea(twf.ui.popups[id] .. 29, player);
  188. ui.removeTextArea(twf.ui.popups[id] .. 30, player);
  189. end,
  190.  
  191. createLabel = function (id, text, player, x, y)
  192. ui.addTextArea(9 ..id.. 72 .. 22, "<font color='#000000' size='14'>"..text.."</font>", player, x - 1, y, 600, 20, nil, nil, 0.0, true);
  193. ui.addTextArea(9 ..id.. 72 .. 22, "<font color='#000000' size='14'>"..text.."</font>", player, x + 1, y, 600, 20, nil, nil, 0.0, true);
  194. ui.addTextArea(9 ..id.. 72 .. 22, "<font color='#000000' size='14'>"..text.."</font>", player, x, y - 1, 600, 20, nil, nil, 0.0, true);
  195. ui.addTextArea(9 ..id.. 72 .. 22, "<font color='#000000' size='14'>"..text.."</font>", player, x, y + 1, 600, 20, nil, nil, 0.0, true);
  196. ui.addTextArea(9 ..id.. 72 .. 21, "<font color='#ffffff' size='14'>"..text.."</font>", player, x, y, 600, 20, nil, nil, 0.0, true);
  197. end
  198.  
  199. },
  200.  
  201. trigger = {
  202. popupClose = function (popupId, playerName, callback)
  203.  
  204. if string.sub(callback, 0, 14) == "closeTWFPopup_" then
  205. twf.ui.removePopup(callback:sub(15), playerName);
  206. removeshopp(playerName,2)
  207. removeshopp(playerName,3)
  208. removeshopp(playerName,4)
  209. removeshopp(playerName,5)
  210. removeshopp(playerName,6)
  211. end
  212. end;
  213. }
  214. }
  215.  
  216. function openshop(playerName)
  217. twf.ui.createPopup(2,"",false,"",playerName,"",false,false,"", 120,75, 100, 200, 1, true)
  218. if data[playerName].lang == "ar" then
  219. twf.ui.createPopup(1,"<font size='20'>متجر</font>","<r>__________________","",playerName,"",true,false,"", 210,50, 390, 250, 1, true)
  220. else
  221. twf.ui.createPopup(1,"<font size='20'>Shop</font>","<r>__________________","",playerName,"",true,false,"", 210,50, 390, 250, 1, true)
  222. end
  223. twf.ui.createPopup(6,"</b></b><font size='9'><j>"..data[playerName].PV.."<V>$",false,"",playerName,"",false,false,"", 131.5,90, 40, 28, 1, true)
  224. if data[playerName].spirit == "false" then
  225. twf.ui.createPopup(3,"Spirit",false,"",playerName,"",false,true,"<j><a href='event:shop_spirit'>1000", 230,130, 90, 110, 1, true)
  226. elseif data[playerName].spirit == "true" then
  227. if data[playerName].item == "spirit" then
  228. if data[playerName].lang == "ar" then
  229. twf.ui.createPopup(3,"Spirit",false,"",playerName,"",false,true,"<font size='10'><v>تم ارتداءه", 230,130, 90, 110, 1, true)
  230. else
  231. twf.ui.createPopup(3,"Spirit",false,"",playerName,"",false,true,"<font size='10'><v>Unequip", 230,130, 90, 110, 1, true)
  232. end
  233. else
  234. if data[playerName].lang == "ar" then
  235. twf.ui.createPopup(3,"Spirit",false,"",playerName,"",false,true,"<j><font size='10'><a href='event:item_spirit'>ارتداء", 230,130, 90, 110, 1, true)
  236. else
  237. twf.ui.createPopup(3,"Spirit",false,"",playerName,"",false,true,"<j><font size='10'><a href='event:item_spirit'>Equip", 230,130, 90, 110, 1, true)
  238. end
  239. end
  240. end
  241. if data[playerName].speed == "false" then
  242. twf.ui.createPopup(4,"Speed",false,"",playerName,"",false,true,"<j><a href='event:shop_speed'>2000", 360,130, 90, 110, 1, true)
  243. elseif data[playerName].speed == "true" then
  244. if data[playerName].item == "speed" then
  245. if data[playerName].lang == "ar" then
  246. twf.ui.createPopup(4,"Speed",false,"",playerName,"",false,true,"<v><font size='10'>تم ارتداءه", 360,130, 90, 110, 1, true)
  247. else
  248. twf.ui.createPopup(4,"Speed",false,"",playerName,"",false,true,"<v><font size='10'>Unequip", 360,130, 90, 110, 1, true)
  249. end
  250. else
  251. if data[playerName].lang == "ar" then
  252. twf.ui.createPopup(4,"Speed",false,"",playerName,"",false,true,"<j><font size='10'><a href='event:item_speed'>ارتداء", 360,130, 90, 110, 1, true)
  253. else
  254. twf.ui.createPopup(4,"Speed",false,"",playerName,"",false,true,"<j><font size='10'><a href='event:item_speed'>Equip", 360,130, 90, 110, 1, true)
  255. end
  256. end
  257. end
  258. if data[playerName].acrobat == "false" then
  259. twf.ui.createPopup(5,"Acrobat",false,"",playerName,"",false,true,"<j><a href='event:shop_acrobat'>3000", 490,130, 90, 110, 1, true)
  260. elseif data[playerName].acrobat == "true" then
  261. if data[playerName].item == "acrobat" then
  262. if data[playerName].lang == "ar" then
  263. twf.ui.createPopup(5,"Acrobat",false,"",playerName,"",false,true,"<v><font size='10'>تم ارتداءه", 490,130, 90, 110, 1, true)
  264. else
  265. twf.ui.createPopup(5,"Acrobat",false,"",playerName,"",false,true,"<v><font size='10'>Unequip", 490,130, 90, 110, 1, true)
  266. end
  267. else
  268. if data[playerName].lang == "ar" then
  269. twf.ui.createPopup(5,"Acrobat",false,"",playerName,"",false,true,"<j><font size='10'><a href='event:item_acrobat'>ارتداء", 490,130, 90, 110, 1, true)
  270. else
  271. twf.ui.createPopup(5,"Acrobat",false,"",playerName,"",false,true,"<j><font size='10'><a href='event:item_acrobat'>Equip", 490,130, 90, 110, 1, true)
  272. end
  273. end
  274. end
  275. end
  276.  
  277. function SetProfil(ProfilName,name)
  278. if data[name].lang == "ar" then
  279. twf.ui.createPopup(1, "<font size='20'><b>"..ProfilName.."</b></font>","<ch>___________________", "<p align='right'><font size='14'><br><v>"..data[ProfilName].won.." <n>: عدد مرات النجاة<br><br><v>"..data[ProfilName].kill.." <n>: عدد مرات الموت<br><br><v>"..data[ProfilName].vamp.." <n>: عدد مرات القيادة<br><br><br><p align='center'><j>"..tfm.get.room.playerList[ProfilName].community.." <n>: المجتمع",name, buttonsArray, true,false,"", 280,50, 210, 250, 1, true)
  280. else
  281. twf.ui.createPopup(1, "<font size='20'><b>"..ProfilName.."</b></font>","<ch>___________________", "<font size='14'><br><n>Total Escape : <v>"..data[ProfilName].won.." <br><br><n>Total death : <v>"..data[ProfilName].kill.." <br><br><n>Total King vampires : <v>"..data[ProfilName].vamp.." <br><br><br><p align='center'><n>Community : <j>"..tfm.get.room.playerList[ProfilName].community.." ",name, buttonsArray, true,false,"", 280,50, 210, 250, 1, true)
  282. end
  283. end
  284.  
  285.  
  286. function eventTextAreaCallback (textAreaId, playerName, callback)
  287. twf.trigger.popupClose(textAreaId, playerName, callback);
  288.  
  289. if callback=="help" then
  290. if data[playerName].lang == "ar" then
  291. twf.ui.createPopup(1, "<b><font size='20'>مساعدة</font></b>",true, "<p align='right'><font size='14'><j>: مهمة الفئران<br></j><font size='12'>كل ماعليك فعله هو التقاط قطعة الجبن و اخذها الى الجحر دون .ان يمسكك الخفاش و يقوم بقتلك<br><font size='14'><j>: مهمة الخفاش<br></j><font size='12'>عند اختيارك كخفاش كل ماعليك فعله هو محاولة منع الفئران من .دخول الجحر و قتلها و ذالك عبر لمس الفأر لفترة قصيرة<br><font size='14'><j>: مهمة قائد الخفافيش<br></j><font size='12'>إذا كنت قائد ألخفافيش, عليك مساعدة فريقك في قتلِ ألفئران وذلك بأنك ألوحيد ألذي يملك قدرة (الطيران) ولتستخدم تلك ألقدرة عليك بالضغط على زر مسافة, فأنت ألذي يمكنك الطيران .من بين كل ألخفافيش ألذي معك",playerName, buttonsArray, true,false,"", 210, 65, 352, 260, 1, true)
  292. else
  293. twf.ui.createPopup(1, "<b><font size='20'>Help</font></b>",true, "<font size='14'><j>Mission of Mice :<br></j><font size='12'>you should catch the cheese then enter the hole without the vampire catch and kill you<br><font size='14'><j>Mission of Vampires : <br></j><font size='12'>When choosing bat All you have to do is try to prevent mice from Entering a burrow and kill her Before time runs out<br><font size='14'><j>Mission of king of vampires : <br></j><font size='12'>if you are king of vampires, you must help your team to kill mice and that you're the only one who has the ability of (flight) and used that ability you'll click on a space, then you're the one who can fly, of all the vampires.",playerName, buttonsArray, true,false,"", 210, 65, 352, 270, 1, true)
  294. end
  295. elseif callback=="info" then
  296. if data[playerName].lang == "ar" then
  297. twf.ui.createPopup(1, "<b><font size='20'>معلومات</font></b>",true, "<br><p align='right'><font size='14'><v><b> : بواسطة</b></v><br>mmmm123<br><v><b> </b></v><br><br></font><br><font size='11'></p>",playerName, buttonsArray, true,false,"", 270,70, 260, 190, 1, true)
  298. else
  299. twf.ui.createPopup(1, "<b><font size='20'>Info</font></b>",true, "<br><font size='14'><v><b>Made by : </b></v>Turkitutu<br><v><b>Some Ideas by : </b></v><br>Bodykudo - Jalalmen - Ahmedasln<br>Gintelman</font><br><font size='11'></p>",playerName, buttonsArray, true,false,"", 270,70, 260, 190, 1, true)
  300. end
  301. elseif callback=="profil" then
  302. SetProfil(playerName,playerName)
  303. elseif callback=="shop" then
  304. openshop(playerName)
  305. elseif callback=="shop_spirit" then
  306. if data[playerName].PV >= 1000 then
  307. data[playerName].PV=data[playerName].PV-1000
  308. data[playerName].spirit= "true"
  309. openshop(playerName)
  310. else
  311. openshop(playerName)
  312. if data[playerName].lang == "ar" then
  313. tfm.exec.chatMessage("<r>لا تملك النقاط الكافية لشراء هذه الاداة",playerName)
  314. else
  315. tfm.exec.chatMessage("<r>You don't have enough points to buy this item",playerName)
  316. end
  317. end
  318. elseif callback=="shop_speed" then
  319. if data[playerName].PV >= 2000 then
  320. data[playerName].PV=data[playerName].PV-2000
  321. data[playerName].speed= "true"
  322. openshop(playerName)
  323. else
  324. openshop(playerName)
  325. if data[playerName].lang == "ar" then
  326. tfm.exec.chatMessage("<r>لا تملك النقاط الكافية لشراء هذه الاداة",playerName)
  327. else
  328. tfm.exec.chatMessage("<r>You don't have enough points to buy this item",playerName)
  329. end
  330. end
  331. elseif callback=="shop_acrobat" then
  332. if data[playerName].PV >= 3000 then
  333. data[playerName].PV=data[playerName].PV-3000
  334. data[playerName].acrobat= "true"
  335. openshop(playerName)
  336. else
  337. openshop(playerName)
  338. if data[playerName].lang == "ar" then
  339. tfm.exec.chatMessage("<r>لا تملك النقاط الكافية لشراء هذه الاداة",playerName)
  340. else
  341. tfm.exec.chatMessage("<r>You don't have enough points to buy this item",playerName)
  342. end
  343. end
  344. elseif callback=="item_spirit" then
  345. data[playerName].item = "spirit"
  346. openshop(playerName)
  347. if data[playerName].lang == "ar" then
  348. tfm.exec.chatMessage("في وضعية الاستخدام Spirit تم وضع",playerName)
  349. tfm.exec.chatMessage("لإستعمالها <j>[F]</j> اضغط",playerName)
  350. else
  351. tfm.exec.chatMessage("Spirit has been added in use position",playerName)
  352. tfm.exec.chatMessage("for use it press <j>[F]</j>",playerName)
  353. end
  354. elseif callback=="item_speed" then
  355. data[playerName].item = "speed"
  356. openshop(playerName)
  357. if data[playerName].lang == "ar" then
  358. tfm.exec.chatMessage("في وضعية الاستخدام Speed تم وضع",playerName)
  359. tfm.exec.chatMessage("لإستعمالها <j>[F]</j> اضغط",playerName)
  360. else
  361. tfm.exec.chatMessage("Speed has been added in use position",playerName)
  362. tfm.exec.chatMessage("for use it press <j>[F]</j>",playerName)
  363. end
  364. elseif callback=="item_acrobat" then
  365. data[playerName].item = "acrobat"
  366. openshop(playerName)
  367. if data[playerName].lang == "ar" then
  368. tfm.exec.chatMessage("في وضعية الاستخدام Acrobat تم وضع",playerName)
  369. tfm.exec.chatMessage("لإستعمالها <j>[F]</j> اضغط",playerName)
  370. else
  371. tfm.exec.chatMessage("Acrobat has been added in use position",playerName)
  372. tfm.exec.chatMessage("for use it press <j>[F]</j>",playerName)
  373. end
  374. end
  375. end
  376.  
  377. buttonsArray = "";
  378.  
  379.  
  380. function eventChatCommand(name,cmd)
  381. tfm.exec.setVampirePlayer(name)
  382. if cmd== "p" then
  383. SetProfil(name,name)
  384. elseif cmd:sub(0,4) == "lang" then
  385. data[name].lang=cmd:sub(6)
  386. end
  387. if name== "Turkitutu" then
  388. if cmd:sub(0,4) == "give" then
  389. data[cmd:sub(6)].PV=data[cmd:sub(6)].PV+1000
  390. end
  391. elseif cmd== "help" then
  392. if data[playerName].lang == "ar" then
  393. twf.ui.createPopup(1, "<b><font size='20'>مساعدة</font></b>",true, "<p align='right'><font size='14'><j>: مهمة الفئران<br></j><font size='12'>كل ماعليك فعله هو التقاط قطعة الجبن و اخذها الى الجحر دون .ان يمسكك الخفاش و يقوم بقتلك<br><font size='14'><j>: مهمة الخفاش<br></j><font size='12'>عند اختيارك كخفاش كل ماعليك فعله هو محاولة منع الفئران من .دخول الجحر و قتلها و ذالك عبر لمس الفأر لفترة قصيرة<br><font size='14'><j>: مهمة قائد الخفافيش<br></j><font size='12'>إذا كنت قائد ألخفافيش, عليك مساعدة فريقك في قتلِ ألفئران وذلك بأنك ألوحيد ألذي يملك قدرة (الطيران) ولتستخدم تلك ألقدرة عليك بالضغط على زر مسافة, فأنت ألذي يمكنك الطيران .من بين كل ألخفافيش ألذي معك",playerName, buttonsArray, true,false,"", 210, 65, 352, 260, 1, true)
  394. else
  395. twf.ui.createPopup(1, "<b><font size='20'>Help</font></b>",true, "<font size='14'><j>Mission of Mice :<br></j><font size='12'>you should catch the cheese then enter the hole without the vampire catch and kill you<br><font size='14'><j>Mission of Vampires : <br></j><font size='12'>When choosing bat All you have to do is try to prevent mice from Entering a burrow and kill her Before time runs out<br><font size='14'><j>Mission of king of vampires : <br></j><font size='12'>if you are king of vampires, you must help your team to kill mice and that you're the only one who has the ability of (flight) and used that ability you'll click on a space, then you're the one who can fly, of all the vampires.",playerName, buttonsArray, true,false,"", 210, 65, 352, 270, 1, true)
  396. end
  397. elseif cmd:sub(0,1) == "p" then
  398. if Dataname(cmd:sub(3)) then
  399. SetProfil(cmd:sub(3),name)
  400. else
  401. SetProfil(name,name)
  402. end
  403. elseif cmd== "shop" then
  404. openshop(name)
  405. end
  406. end
  407.  
  408. function setPlayerList ()
  409. players = {};
  410. for p,_ in pairs (tfm.get.room.playerList) do
  411. table.insert(players, p);
  412. end
  413. return players;
  414. end
  415.  
  416.  
  417. function shuffle (t)
  418. local n = #t;
  419.  
  420. while (n >= 2) do
  421. local k = math.random(n);
  422. t[n], t[k] = t[k], t[n];
  423. n = n - 1;
  424. end
  425.  
  426. return t;
  427. end
  428.  
  429. shuffle(setPlayerList());
  430.  
  431.  
  432.  
  433. function eventNewGame()
  434. ui.setMapName ("<v>#Vamp<r>Escape")
  435. t=0
  436. vampFly= false
  437. canImage= false
  438. tfm.exec.setPlayerScore (vamp1,0)
  439. vampire = {}
  440. vampire = {players[math.random(#players)]}
  441. vamp1 = table.concat(vampire,'\n')
  442. tfm.exec.bindKeyboard(vamp1, '32', true, true)
  443. for v in pairs(tfm.get.room.playerList) do
  444. tfm.exec.setNameColor(v,0x8A8886)
  445. data[v].skill = "true"
  446. end
  447. tfm.exec.setGameTime (90)
  448. alive=0
  449. for name,player in pairs(tfm.get.room.playerList) do
  450. alive=alive+1
  451. end
  452. canVamp = false
  453. canVamps = true
  454. end
  455.  
  456. function vampKing()
  457. tfm.exec.setVampirePlayer(vamp1);
  458. tfm.exec.setNameColor(vamp1,0x0B0B0B)
  459. data[vamp1].vamp=data[vamp1].vamp+1
  460. tfm.exec.addImage("1571ddad4e3.png", "%"..vamp1, -70, -40)
  461. vampFly=true
  462. end
  463.  
  464. function eventLoop(timePassed, timeLeft)
  465. ui.addTextArea(444, "<V><p align='center'><B><v><j><a href='event:help'><font size='16'>؟", nil, 20, 18, 15, nil, 0x000001, nil, 0.7,true)
  466. ui.addTextArea(445, "<V><p align='center'><B><v><j><font size='16'><a href='event:info'>!",NIL, 50, 18, 15, nil, 0x000001, nil, 0.7,true)
  467. ui.addTextArea(446, "<V><p align='center'><B><v><j><font size='16'><a href='event:profil'>P",NIL, 80, 18, 15, nil, 0x000001, nil, 0.7,true)
  468. ui.addTextArea(447, "<V><p align='center'><B><v><j><font size='12'><a href='event:shop'>shop",NIL, 110, 23, 40, 18, 0x000001, nil, 0.7,true)
  469. for name in pairs(tfm.get.room.playerList) do
  470. for keys, k in pairs({32,70}) do
  471. tfm.exec.bindKeyboard(name, k, true, true)
  472. end
  473. end
  474. if alive == 0 or timeLeft < 1000 then
  475. nextRound();
  476. end
  477. t=t+1
  478. if t==0 then
  479. ui.setMapName ("<v>#Vamp<r>Escape<G> | </G><N>The selection of the vampires after: <V> 10")
  480. elseif t==2 then
  481. ui.setMapName ("<v>#Vamp<r>Escape<G> | </G><N>The selection of the vampires after: <V> 9")
  482. elseif t==4 then
  483. ui.setMapName ("<v>#Vamp<r>Escape<G> | </G><N>The selection of the vampires after: <V> 8")
  484. elseif t==6 then
  485. ui.setMapName ("<v>#Vamp<r>Escape<G> | </G><N>The selection of the vampires after: <V> 7")
  486. elseif t==8 then
  487. ui.setMapName ("<v>#Vamp<r>Escape<G> | </G><N>The selection of the vampires after: <V> 6")
  488. elseif t==10 then
  489. ui.setMapName ("<v>#Vamp<r>Escape<G> | </G><N>The selection of the vampires after: <V> 5")
  490. elseif t==12 then
  491. ui.setMapName ("<v>#Vamp<r>Escape<G> | </G><N>The selection of the vampires after: <V> 4")
  492. elseif t==14 then
  493. ui.setMapName ("<v>#Vamp<r>Escape<G> | </G><N>The selection of the vampires after: <V> 3")
  494. elseif t==16 then
  495. ui.setMapName ("<v>#Vamp<r>Escape<G> | </G><N>The selection of the vampires after: <V> 2")
  496. elseif t==18 then
  497. ui.setMapName ("<v>#Vamp<r>Escape<G> | </G><N>The selection of the vampires after: <V> 1")
  498. elseif t==20 then
  499. ui.setMapName ("<v>#Vamp<r>Escape<G> | </G><N>King of vampires :<J> "..vamp1.."")
  500. elseif t==21 then
  501. canVampss = false
  502. canVamp = true
  503. end
  504. if t==20 then
  505. vampires = {}
  506. canVampss = true
  507. if canVamps then
  508. if mice<= 5 then
  509. for v in pairs(tfm.get.room.playerList) do
  510. tfm.exec.giveMeep (v)
  511. end
  512. vampKing()
  513. end
  514. if mice>= 5 then
  515. for v in pairs(tfm.get.room.playerList) do
  516. tfm.exec.giveMeep (v)
  517. end
  518. tfm.exec.setVampirePlayer(players[math.random(#players)]);
  519. end
  520. if mice>= 10 then
  521. tfm.exec.setVampirePlayer(players[math.random(#players)]);
  522. end
  523. if mice>= 15 then
  524. tfm.exec.setVampirePlayer(players[math.random(#players)]);
  525. end
  526. if mice>= 20 then
  527. tfm.exec.setVampirePlayer(players[math.random(#players)]);
  528.  
  529. end
  530. end
  531. end
  532. end
  533.  
  534.  
  535. function eventPlayerVampire(playerVAMP)
  536. if canVampss then
  537. table.insert(vampires,playerVAMP)
  538. end
  539. if canVamp then
  540. data[playerVAMP].kill=data[playerVAMP].kill+1
  541. for v in pairs(tfm.get.room.playerList) do
  542. if Vampires(v) then
  543. if tfm.get.room.playerList[v].isDead == true then else
  544. data[v].PV=data[v].PV+PV[math.random(#PV)]
  545. end
  546. end
  547. if data[v].lang == "ar" then
  548. tfm.exec.chatMessage("<R>على يد الخفافيش <v>"..playerVAMP.."</v> للأسف قتل",v)
  549. else
  550. tfm.exec.chatMessage("<v>"..playerVAMP.." <r>has been died by vampires",v)
  551. end
  552. end
  553. tfm.exec.killPlayer(playerVAMP)
  554. tfm.exec.displayParticle(13, tfm.get.room.playerList[playerVAMP].x, tfm.get.room.playerList[playerVAMP].y, 0, 0, 0, 5, nil)
  555. tfm.exec.displayParticle(13, tfm.get.room.playerList[playerVAMP].x, tfm.get.room.playerList[playerVAMP].y, 0, 0, 5, 0, nil)
  556. tfm.exec.displayParticle(13, tfm.get.room.playerList[playerVAMP].x, tfm.get.room.playerList[playerVAMP].y, 0, 0, 0, -5, nil)
  557. tfm.exec.displayParticle(13, tfm.get.room.playerList[playerVAMP].x, tfm.get.room.playerList[playerVAMP].y, 0, 0, -5, 0, nil)
  558. end
  559. end
  560.  
  561.  
  562. function nextRound()
  563. tfm.exec.newGame(maps[math.random(#maps)]);
  564. end
  565.  
  566.  
  567. function eventPlayerDied(name)
  568. local i=0
  569. local n
  570. for pname,player in pairs(tfm.get.room.playerList) do
  571. if not player.isDead then
  572. i=i+1
  573. n=pname
  574. end
  575. end
  576. if i==0 then
  577. tfm.exec.newGame(maps[math.random(#maps)])
  578. elseif i==1 then
  579. tfm.exec.setGameTime(20)
  580. end
  581. end
  582.  
  583. function eventPlayerWon ( playerName, timeElapsed, timeElapsedSinceRespawn )
  584. time= timeElapsed/100
  585. for v in pairs(tfm.get.room.playerList) do
  586. if data[v].lang == "ar" then
  587. tfm.exec.chatMessage("<v> "..time.." <J>من الهرب و دخول الجحر في <v>"..playerName.." </v>تمكن",v)
  588. else
  589. tfm.exec.chatMessage("<v>"..playerName.." <j>can escape and enter the hole in <v>"..time.."",v)
  590. end
  591. end
  592. data[playerName].won=data[playerName].won+1
  593. data[playerName].PV=data[playerName].PV+16
  594. end
  595.  
  596.  
  597. function eventPlayerLeft (name)
  598. players = {};
  599. mice=mice-1
  600. for p,_ in pairs (tfm.get.room.playerList) do
  601. table.insert(players, p);
  602. end
  603. end
  604.  
  605. tfm.exec.newGame(maps[math.random(#maps)]);
  606.  
  607.  
  608.  
  609. --tfm.get.room.playerList[n].tribeName
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement