Advertisement
mmmm123m

Untitled

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