Advertisement
mmmm123m

Untitled

Jul 25th, 2017
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 24.08 KB | None | 0 0
  1. id = {}
  2. data={}
  3. ghost = {}
  4. ghosts = {}
  5. dataname = {}
  6. mice=0
  7. t=0
  8. tt=0
  9. POINTS_SKILL1=500
  10. POINTS_SKILL2=1500
  11. POINTS_SKILL3=2500
  12. POINTS_PLAYERS=0
  13. module="<font color='#797979'>#Ghost"
  14. tfm.exec.disableAutoShaman(true);
  15. tfm.exec.disableAutoNewGame(true);
  16. maps = {7119865 ,7119840 ,7119708 ,7119745 ,7119804 ,7119879}
  17. --maps = {7119804}
  18. --maps = {7119865}
  19.  
  20. PV = {7,8,9,10,11,13}
  21. system.disableChatCommandDisplay("give", true)
  22.  
  23. function Ghost(n)
  24. for i,ghost in ipairs(ghost) do
  25. if n==ghost then
  26. return true
  27. end
  28. end
  29. return false
  30. end
  31. function Ghosts(n)
  32. for i,ghosts in ipairs(ghosts) do
  33. if n==ghosts then
  34. return true
  35. end
  36. end
  37. return false
  38. end
  39. function Dataname(n)
  40. for i,dataname in ipairs(dataname) do
  41. if n==dataname then
  42. return true
  43. end
  44. end
  45. return false
  46. end
  47. TextArea = function(n,id)
  48. if id then
  49. if id == 1 then
  50. ui.removeTextArea(446,n);
  51. ui.removeTextArea(445,n);
  52. ui.removeTextArea(444,n);
  53. ui.removeTextArea(443,n);
  54. ui.addTextArea(442, "<V><p align='center'><B><v><j><a href='event:openArea'><font size='16'>»",n, 20, 18, 15, nil, 0x000001, nil, 0.7,true)
  55. elseif id == 2 then
  56. ui.addTextArea(446, "<V><p align='center'><B><v><j><a href='event:help'><font size='16'>؟", n, 20, 18, 15, nil, 0x000001, nil, 0.7,true)
  57. ui.addTextArea(445, "<V><p align='center'><B><v><j><font size='16'><a href='event:info'>!",n, 50, 18, 15, nil, 0x000001, nil, 0.7,true)
  58. ui.addTextArea(444, "<V><p align='center'><B><v><j><font size='16'><a href='event:profil'>P",n, 80, 18, 15, nil, 0x000001, nil, 0.7,true)
  59. ui.addTextArea(443, "<V><p align='center'><B><v><j><font size='12'><a href='event:shop'>shop",n, 110, 23, 40, 18, 0x000001, nil, 0.7,true)
  60. ui.addTextArea(442, "<V><p align='center'><B><v><j><a href='event:claseArea'><font size='16'>«",n, 165, 18, 15, nil, 0x000001, nil, 0.7,true)
  61. end
  62. end
  63. end
  64.  
  65. function addData(n)
  66. data[n]={won=0,kill=0,vamp=0,lang=tfm.get.room.playerList[n].community,PV=1000,item="",skill1="false",skill2="false",skill3="false",skill="false",timee=0}
  67. end
  68.  
  69. function eventNewPlayer(n)
  70. mice=mice+1
  71. players = {};
  72. for p,_ in pairs (tfm.get.room.playerList) do
  73. table.insert(players,n);
  74. end
  75. if Dataname(n) then else
  76. addData(n)
  77. table.insert(dataname,n)
  78. end
  79. tfm.exec.chatMessage(getTrans(n,"CHAT_MESSAGE","WELCOME"),n)
  80. TextArea(n,1)
  81. end
  82.  
  83. translation = {
  84. ar = {
  85. CHAT_MESSAGE = {
  86. WELCOME = "<vp>#Ghost مرحبًا بك في<br><j>لفتح قائمة مساعدة<v> !help <j>قم بكتابة<br><j>لفتح المتجر<v> !shop <j>قم بكتابة<br><j>لفتح ملف شخصي<v> !p أسم شخص <j>-</j> !p <j>قم بكتابة<br><j>لفتح معلومات<v> !info <j>قم بكتابة",
  87. ERROR_TIME_USE = "<r>يمكنك استعمال هذه الاداة فقط مرة واحدة كل 20 ثانية",
  88. ERROR_BUY_SKIILS = "<r>لا تملك النقاط الكافية لشراء هذه الاداة",
  89. USE_SKILL_1 = "في وضعية الاستخدام <j>Spirit</j> تم وضع<br>لإستعمالها <j>[F]</j> اضغط",
  90. USE_SKILL_2 = "في وضعية الاستخدام <j>Speed</j> تم وضع<br>لإستعمالها <j>[F]</j> اضغط",
  91. USE_SKILL_3 = "في وضعية الاستخدام <j>Acrobat</j> تم وضع<br>لإستعمالها <j>[F]</j> اضغط",
  92. WON_MOUSE1= "<J>الهرب من الأشباح <v>",
  93. WON_MOUSE2= "</v>إستطاع",
  94. KILL_MOUSE1 = "<R>على يد الأشباح <v>",
  95. KILL_MOUSE2 = "</v> قُتل",
  96. },
  97. INFO = {
  98. TITLE = "<b><font size='20'>معلومات</font></b>",
  99. TEXT = "<br><p align='right'><font size='13'>Mmmm123 , Turkitutu<j> : بواسطة</j><br><j> : طاقم الخرائط </j></font><br><font size='11'> Dfdskjfhaifs , Boucharma </p>",
  100. },
  101. SHOP = {
  102. TITLE = "<font size='20'>متجر",
  103. TITLE_SKILL_1 = "فرقعة",
  104. TITLE_SKILL_2 = "سرعة",
  105. TITLE_SKILL_3 = "إختراق",
  106. EQUIP_SKILL_1 = "<j><font size='10'><a href='event:item_skill1'>إرتداء",
  107. EQUIP_SKILL_2 = "<j><font size='10'><a href='event:item_skill2'>إرتداء",
  108. EQUIP_SKILL_3 = "<j><font size='10'><a href='event:item_skill3'>إرتداء",
  109. UNEQIIP_SKILL = "<font size='10'><v>تم إرتداءه",
  110. },
  111. PROFIL = {
  112. TEXT1="<p align='right'><font size='14'><br><v>",
  113. TEXT2=" <n>: عدد مرات النجاة<br><br><v>",
  114. TEXT3=" <n>: عدد مرات الموت<br><br><v>",
  115. TEXT4=" <n>: عدد مرات القيادة<br><br><br><p align='center'><j>",
  116. TEXT5=" <n>: المجتمع",
  117. },
  118. HELP = {
  119. TITLE = "<b><font size='20'>مساعدة</font></b>",
  120. TEXT = "<p align='right'><font size='14'><j>: مهمة الفئران<br></j><font size='12'>كل ماعليك فعله هو التقاط قطعة الجبن و اخذها الى الجحر دون <BR>.ان يمسكك شبح و يقوم بقتلك <br><font size='14'><j>: مهمة الشبح<br></j><font size='12'>عند اختيارك كشبح كل ماعليك فعله هو محاولة منع الفئران<BR>.من دخول الجحر و قتلها و ذالك عبر لمس الفأر لفترة قصيرة <br><font size='14'><j>: مهمة ملك الاشباح<br></j><font size='12'>إذا كنت ملك الاشباح, عليك مساعدة فريقك في قتلِ ألفئران <br>وذلك بأنك ألوحيد ألذي يملك قدرة (الطيران) ولتستخدم تلك ألقدرة<br> عليك بالضغط على زر مسافة, فأنت ألذي يمكنك الطيران <br>.من بين كل الاشباح ألذي معك ",
  121. },
  122. TEXT_AREA = {
  123. CLASE ="اغلاق النافذة",
  124. },
  125. },
  126. en = {
  127. CHAT_MESSAGE = {
  128. WELCOME = "<vp>Welcome to #Ghost<br><J>Type <v>!help</v> to ......<br>Type <v>!shop </v>to ......<br>Type<v> !p </v> or <v> !p PlayerName </v>to ......<br>Type <v>!info </v>to ......<br>",
  129. ERROR_TIME_USE = "<r>You can use this tool one time for every round",
  130. ERROR_BUY_SKIILS = "<r>You don't have enough points to buy this item",
  131. USE_SKILL_1 = "<j>Spirit</j> has been added in use position<br>For use it press <j>[F]</j>",
  132. USE_SKILL_2 = "<j>Speed</j> has been added in use position<br>For use it press <j>[F]</j>",
  133. USE_SKILL_3 = "<j>Acrobat</j> has been added in use position<br>For use it press <j>[F]</j>",
  134. WON_MOUSE1 = "<v>",
  135. WON_MOUSE2 = " <j>can escape and enter the hole",
  136. KILL_MOUSE1 = "<v>",
  137. KILL_MOUSE2 = " <r>has been died by ghosts." ,
  138. },
  139. INFO = {
  140. TITLE = "<b><font size='20'>Info</font></b>",
  141. TEXT = "<br><font size='13'><v>Made by : </v>Mmmm123 , Turkitutu<br><v></v><br><v>Map crew : </v> </font><br><font size='11'> Dfdskjfhaifs , Boucharma </p>",
  142. },
  143. SHOP = {
  144. TITLE = "<font size='20'>Shop",
  145. TITLE_SKILL_1 = "Spirit",
  146. TITLE_SKILL_2 = "Speed",
  147. TITLE_SKILL_3 = "Acrobat",
  148. EQUIP_SKILL_1 = "<j><font size='10'><a href='event:item_skill1'>Equip",
  149. EQUIP_SKILL_2 = "<j><font size='10'><a href='event:item_skill2'>Equip",
  150. EQUIP_SKILL_3 = "<j><font size='10'><a href='event:item_skill3'>Equip",
  151. UNEQIIP_SKILL = "<font size='10'><v>Unequip",
  152. },
  153. PROFIL = {
  154. TEXT1="<font size='14'><br><n>Total Escape : <v>",
  155. TEXT2=" <br><br><n>Total death : <v>",
  156. TEXT3=" <br><br><n>Total King Ghosts : <v>",
  157. TEXT4=" <br><br><br><p align='center'><n>Community : <j>",
  158. TEXT5="",
  159. },
  160. HELP = {
  161. TITLE = "<b><font size='20'>Help</font></b>",
  162. TEXT = "<font size='14'><j>Mission of Mice :<br></j><font size='12'>You should catch the cheese then enter the hole without the ghost catch and dont let he kill you<br><font size='14'><j>Mission of Ghosts : <br></j><font size='12'>When bat got choosed 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 The King Ghosts : <br></j><font size='12'>If you are The Ghost, you must help your team to kill mice and that you're the only one who has the ability of (flight) and for use this ability on a space, then you're the only one who can fly, of all the ghosts.",
  163. },
  164. TEXT_AREA = {
  165. CLASE ="Close",
  166. },
  167. },
  168. }
  169.  
  170. for n,player in pairs(tfm.get.room.playerList) do
  171. mice=mice+1
  172. addData(n)
  173. TextArea(n,1)
  174. table.insert(dataname,n)
  175. end
  176.  
  177. getTrans = function(n,id1,id2)
  178. for n in pairs (tfm.get.room.playerList) do
  179. if translation[data[n].lang] then
  180. return translation[data[n].lang][id1][id2]
  181. else
  182. return translation["en"][id1][id2]
  183. end
  184. end
  185. end
  186.  
  187. function eventKeyboard(n, key, down, x, y)
  188. if key == 38 then
  189. if Ghost(n) then
  190. if vampFly then
  191. tfm.exec.movePlayer(n,0,0,false,0,-40,false)
  192. end
  193. end
  194.  
  195. elseif key == 37 then
  196. if canImgvamp then
  197. if Ghost(n) then
  198. tfm.exec.removeImage(id[n])
  199. id[n] = tfm.exec.addImage("157f3259f31.png", "%"..n, -35, -50) -- ←
  200. end
  201. end
  202.  
  203. elseif key == 39 then
  204. if canImgvamp then
  205. if Ghost(n) then
  206. tfm.exec.removeImage(id[n])
  207. id[n] = tfm.exec.addImage("157f325dcc3.png", "%"..n, -35, -50) -- →
  208. end
  209. end
  210.  
  211. elseif key == 90 then
  212. if Ghost(n) then
  213. if vampFly then
  214. tfm.exec.movePlayer(n,0,0,false,0,-40,false)
  215. end
  216. end
  217.  
  218. elseif key == 32 then
  219. if Ghost(n) then
  220. if vampFly then
  221. tfm.exec.movePlayer(n,0,0,false,0,-40,false)
  222. end
  223. end
  224. elseif key == 70 then
  225. if data[n].timee <= 0 then
  226. if data[n].item == "skill1" then
  227. tfm.exec.displayParticle(12,x,y+30)
  228. tfm.exec.movePlayer(n,0,0,true,0,-100,false)
  229. data[n].timee = 21
  230. elseif data[n].item == "skill2" then
  231. if tfm.get.room.playerList[n].isFacingRight then
  232. tfm.exec.displayParticle(26,x+20,y)
  233. tfm.exec.displayParticle(26,x+30,y)
  234. tfm.exec.displayParticle(26,x+40,y)
  235. tfm.exec.displayParticle(26,x+50,y)
  236. tfm.exec.movePlayer(n,0,0,true,100,0,false)
  237. data[n].timee = 21
  238. else
  239. tfm.exec.displayParticle(26,x-20,y)
  240. tfm.exec.displayParticle(26,x-30,y)
  241. tfm.exec.displayParticle(26,x-40,y)
  242. tfm.exec.displayParticle(26,x-50,y)
  243. tfm.exec.movePlayer(n,0,0,true,-100,0,false)
  244. data[n].timee = 21
  245. end
  246. elseif data[n].item == "skill3" then
  247. if tfm.get.room.playerList[n].isFacingRight then
  248. tfm.exec.displayParticle(35,x+20,y,0,0,0,0)
  249. tfm.exec.movePlayer(n,x+65,0)
  250. data[n].timee = 21
  251. else
  252. tfm.exec.displayParticle(35,x-20,y,0,0,0,0)
  253. tfm.exec.movePlayer(n,x-65,0)
  254. data[n].timee = 21
  255. end
  256. end
  257. else
  258. tfm.exec.chatMessage(getTrans(n,"CHAT_MESSAGE","ERROR_TIME_USE"),n)
  259. end
  260. end
  261. end
  262.  
  263. removeshopp = function(n,id)
  264. ui.removeTextArea(9 ..id.. 3621,n);
  265. ui.removeTextArea(9 ..id.. 3622,n);
  266. ui.removeTextArea(9 ..id.. 3623,n);
  267. ui.removeTextArea(9 ..id.. 3624,n);
  268. ui.removeTextArea(9 ..id.. 3625,n);
  269. ui.removeTextArea(9 ..id.. 3626,n);
  270. ui.removeTextArea(9 ..id.. 3627,n);
  271. ui.removeTextArea(9 ..id.. 3628,n);
  272. ui.removeTextArea(9 ..id.. 3629,n);
  273. ui.removeTextArea(9 ..id.. 3630,n);
  274. ui.removeTextArea(9 ..id.. 3631,n);
  275. end
  276.  
  277. twf = {
  278. ui = {
  279. popups = {},
  280. createPopup = function(id, title,tt, text, player, buttons, closable,shopbt,textbt, x, y, w, h, alpha, U)
  281. if tt== true then
  282. tt=" _______________________<br>"
  283. end
  284. if tt== false then
  285. tt=""
  286. end
  287. ui.addTextArea(9 ..id.. 36 .. 21, "",player,x+-2,y+18,w+24,h+14,0x2E221B,0x2E221B,alpha,true);
  288. ui.addTextArea(9 ..id.. 36 .. 22, "",player,x+-1,y+19,w+22,h+12,0x986742,0x986742,alpha,true);
  289. ui.addTextArea(9 ..id.. 36 .. 23, "",player,x+2,y+22,w+16,h+6,0x171311,0x171311,alpha,true);
  290. ui.addTextArea(9 ..id.. 36 .. 24, "",player,x+3,y+23,w+14,h+4,0x0C191C,0x0C191C,alpha,true);
  291. ui.addTextArea(9 ..id.. 36 .. 25, "",player,x+4,y+24,w+12,h+2,0x24474D,0x24474D,alpha,true);
  292. ui.addTextArea(9 ..id.. 36 .. 26, "",player,x+5,y+25,w+10,h+0,0x183337,0x183337,alpha,true);
  293. 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);
  294.  
  295. if closable then
  296. ui.addTextArea(9 ..id.. 36 .. 28, "",player,x+15,y+h-20+25,w-10,15,0x5D7D90,0x5D7D90,alpha,true);
  297. ui.addTextArea(9 ..id.. 36 .. 29, "",player,x+15,y+h-20+27,w-10,15,0x11171C,0x11171C,alpha,true);
  298. ui.addTextArea(9 ..id.. 36 .. 30, "<p align='center'><a href='event:closeTWFPopup_".. 9 ..id.. 36 .."'><N>"..getTrans(player,"TEXT_AREA","CLASE").."</a>", player,x+15,y+h-20+26,w-10,15,0x3C5064,0x3C5064,alpha,true);
  299.  
  300. end;
  301.  
  302. if shopbt then
  303. ui.addTextArea(9 ..id.. 36 .. 28, "",player,x+15,y+h-20+25,w-10,15,0x5D7D90,0x5D7D90,alpha,true);
  304. ui.addTextArea(9 ..id.. 36 .. 29, "",player,x+15,y+h-20+27,w-10,15,0x11171C,0x11171C,alpha,true);
  305. ui.addTextArea(9 ..id.. 36 .. 30, "<p align='center'>"..textbt.."", player,x+15,y+h-20+26,w-10,15,0x3C5064,0x3C5064,alpha,true);
  306.  
  307. end;
  308.  
  309.  
  310. twf.ui.popups[tostring("9"..id.."36")] = 9 ..id.. 36;
  311.  
  312. end,
  313.  
  314. removePopup = function(id, player) -- Define the var as a function.
  315. ui.removeTextArea(twf.ui.popups[id] .. 21, player);
  316. ui.removeTextArea(twf.ui.popups[id] .. 22, player);
  317. ui.removeTextArea(twf.ui.popups[id] .. 23, player);
  318. ui.removeTextArea(twf.ui.popups[id] .. 24, player);
  319. ui.removeTextArea(twf.ui.popups[id] .. 25, player);
  320. ui.removeTextArea(twf.ui.popups[id] .. 26, player);
  321. ui.removeTextArea(twf.ui.popups[id] .. 27, player);
  322. ui.removeTextArea(twf.ui.popups[id] .. 28, player);
  323. ui.removeTextArea(twf.ui.popups[id] .. 29, player);
  324. ui.removeTextArea(twf.ui.popups[id] .. 30, player);
  325. end,
  326.  
  327. createLabel = function(id, text, player, x, y)
  328. ui.addTextArea(9 ..id.. 72 .. 22, "<font color='#000000' size='14'>"..text.."</font>", player, x - 1, y, 600, 20, nil, nil, 0.0, true);
  329. ui.addTextArea(9 ..id.. 72 .. 22, "<font color='#000000' size='14'>"..text.."</font>", player, x + 1, y, 600, 20, nil, nil, 0.0, true);
  330. ui.addTextArea(9 ..id.. 72 .. 22, "<font color='#000000' size='14'>"..text.."</font>", player, x, y - 1, 600, 20, nil, nil, 0.0, true);
  331. ui.addTextArea(9 ..id.. 72 .. 22, "<font color='#000000' size='14'>"..text.."</font>", player, x, y + 1, 600, 20, nil, nil, 0.0, true);
  332. ui.addTextArea(9 ..id.. 72 .. 21, "<font color='#ffffff' size='14'>"..text.."</font>", player, x, y, 600, 20, nil, nil, 0.0, true);
  333. end
  334.  
  335. },
  336.  
  337. trigger = {
  338. popupClose = function(popupId, playerName, callback)
  339.  
  340. if string.sub(callback, 0, 14) == "closeTWFPopup_" then
  341. twf.ui.removePopup(callback:sub(15), playerName);
  342. removeshopp(playerName,2)
  343. removeshopp(playerName,3)
  344. removeshopp(playerName,4)
  345. removeshopp(playerName,5)
  346. removeshopp(playerName,6)
  347. ui.removeTextArea(8764524789,playerName);
  348. end
  349. end;
  350. }
  351. }
  352.  
  353. function openshop(n)
  354. twf.ui.createPopup(2,"",false,"",n,"",false,false,"", 120,75, 100, 200, 1, true)
  355. twf.ui.createPopup(1,getTrans(n,"SHOP","TITLE"),"<r>__________________","",n,"",true,false,"", 210,50, 390, 250, 1, true)
  356. twf.ui.createPopup(6,"</b></b><font size='9'><j>"..data[n].PV.."<V>$",false,"",n,"",false,false,"", 131.5,90, 40, 28, 1, true)
  357. if data[n].skill1 == "false" then
  358. twf.ui.createPopup(3,getTrans(n,"SHOP","TITLE_SKILL_1"),false,"",n,"",false,true,"<j><a href='event:shop_skill1'>"..POINTS_SKILL1.."", 230,130, 90, 110, 1, true)
  359. elseif data[n].skill1 == "true" then
  360. if data[n].item == "skill1" then
  361. twf.ui.createPopup(3,getTrans(n,"SHOP","TITLE_SKILL_1"),false,"",n,"",false,true,getTrans(n,"SHOP","UNEQIIP_SKILL"), 230,130, 90, 110, 1, true)
  362. else
  363. twf.ui.createPopup(3,getTrans(n,"SHOP","TITLE_SKILL_1"),false,"",n,"",false,true,getTrans(n,"SHOP","EQUIP_SKILL_1"), 230,130, 90, 110, 1, true)
  364. end
  365. end
  366. if data[n].skill2 == "false" then
  367. twf.ui.createPopup(4,getTrans(n,"SHOP","TITLE_SKILL_2"),false,"",n,"",false,true,"<j><a href='event:shop_skill2'>"..POINTS_SKILL2.."", 360,130, 90, 110, 1, true)
  368. elseif data[n].skill2 == "true" then
  369. if data[n].item == "skill2" then
  370. twf.ui.createPopup(4,getTrans(n,"SHOP","TITLE_SKILL_2"),false,"",n,"",false,true,getTrans(n,"SHOP","UNEQIIP_SKILL"), 360,130, 90, 110, 1, true)
  371. else
  372. twf.ui.createPopup(4,getTrans(n,"SHOP","TITLE_SKILL_2"),false,"",n,"",false,true,getTrans(n,"SHOP","EQUIP_SKILL_2"), 360,130, 90, 110, 1, true)
  373. end
  374. end
  375. if data[n].skill3 == "false" then
  376. twf.ui.createPopup(5,getTrans(n,"SHOP","TITLE_SKILL_3"),false,"",n,"",false,true,"<j><a href='event:shop_skill3'>"..POINTS_SKILL3.."", 490,130, 90, 110, 1, true)
  377. elseif data[n].skill3 == "true" then
  378. if data[n].item == "skill3" then
  379. twf.ui.createPopup(5,getTrans(n,"SHOP","TITLE_SKILL_3"),false,"",n,"",false,true,getTrans(n,"SHOP","UNEQIIP_SKILL"), 490,130, 90, 110, 1, true)
  380. else
  381. twf.ui.createPopup(5,getTrans(n,"SHOP","TITLE_SKILL_3"),false,"",n,"",false,true,getTrans(n,"SHOP","EQUIP_SKILL_3"), 490,130, 90, 110, 1, true)
  382. end
  383. end
  384. end
  385.  
  386. function OpenProfil(ProfilName,n)
  387. twf.ui.createPopup(1, "<font size='20'><b>"..ProfilName.."</b></font>","<ch>___________________",getTrans(n,"PROFIL","TEXT1")..data[ProfilName].won..getTrans(n,"PROFIL","TEXT2")..data[ProfilName].kill..getTrans(n,"PROFIL","TEXT3")..data[ProfilName].vamp..getTrans(n,"PROFIL","TEXT4")..tfm.get.room.playerList[ProfilName].community..getTrans(n,"PROFIL","TEXT5"),n, buttonsArray, true,false,"", 280,50, 210, 250, 1, true)
  388. end
  389.  
  390. function OpenHelp(n)
  391. if data[n].lang == "ar" then
  392. twf.ui.createPopup(1,getTrans(n,"HELP","TITLE"),true,"",n, buttonsArray, true,false,"", 210, 65, 352, 260, 1, true)
  393. ui.addTextArea(8764524789,getTrans(n,"HELP","TEXT"),n, 240, 145, 335, 180, 0x000001, nil, 0.0,true)
  394. else
  395. twf.ui.createPopup(1,getTrans(n,"HELP","TITLE"),true,getTrans(n,"HELP","TEXT"),n, buttonsArray, true,false,"", 210, 65, 352, 270, 1, true)
  396. end
  397. end
  398.  
  399. function OpenInfo(n)
  400. twf.ui.createPopup(1,getTrans(n,"INFO","TITLE"),true,getTrans(n,"INFO","TEXT"),n, buttonsArray, true,false,"", 210,70, 350, 190, 1, true)
  401. end
  402.  
  403.  
  404. function eventTextAreaCallback(textAreaId,n, callback)
  405. twf.trigger.popupClose(textAreaId,n, callback);
  406.  
  407. if callback=="help" then
  408. OpenHelp(n)
  409. elseif callback=="info" then
  410. OpenInfo(n)
  411. elseif callback=="profil" then
  412. OpenProfil(n,n)
  413. elseif callback=="shop" then
  414. openshop(n)
  415. elseif callback=="openArea" then
  416. TextArea(n,2)
  417. elseif callback=="claseArea" then
  418. TextArea(n,1)
  419. elseif callback=="shop_skill1" then
  420. if data[n].PV >= POINTS_SKILL1 then
  421. data[n].PV=data[n].PV-POINTS_SKILL1
  422. data[n].skill1= "true"
  423. openshop(n)
  424. else
  425. openshop(n)
  426. tfm.exec.chatMessage(getTrans(n,"CHAT_MESSAGE","ERROR_BUY_SKIILS"),n)
  427. end
  428. elseif callback=="shop_skill2" then
  429. if data[n].PV >= POINTS_SKILL2 then
  430. data[n].PV=data[n].PV-POINTS_SKILL2
  431. data[n].skill2= "true"
  432. openshop(n)
  433. else
  434. openshop(n)
  435. tfm.exec.chatMessage(getTrans(n,"CHAT_MESSAGE","ERROR_BUY_SKIILS"),n)
  436. end
  437. elseif callback=="shop_skill3" then
  438. if data[n].PV >= POINTS_SKILL3 then
  439. data[n].PV=data[n].PV-POINTS_SKILL3
  440. data[n].skill3= "true"
  441. openshop(n)
  442. else
  443. openshop(n)
  444. tfm.exec.chatMessage(getTrans(n,"CHAT_MESSAGE","ERROR_BUY_SKIILS"),n)
  445. end
  446. elseif callback=="item_skill1" then
  447. data[n].item = "skill1"
  448. openshop(n)
  449. tfm.exec.chatMessage(getTrans(n,"CHAT_MESSAGE","USE_SKILL_1"),n)
  450. print(getTrans(n,"CHAT_MESSAGE","USE_SKILL_1"))
  451. elseif callback=="item_skill2" then
  452. data[n].item = "skill2"
  453. openshop(n)
  454. tfm.exec.chatMessage(getTrans(n,"CHAT_MESSAGE","USE_SKILL_2"),n)
  455. elseif callback=="item_skill3" then
  456. data[n].item = "skill3"
  457. openshop(n)
  458. tfm.exec.chatMessage(getTrans(n,"CHAT_MESSAGE","USE_SKILL_3"),n)
  459. end
  460. end
  461.  
  462. buttonsArray = "";
  463.  
  464. function eventChatCommand(n,cmd)
  465. if cmd:sub(0,4) == "give" then
  466. if n== "Mmmm123" then
  467. data[cmd:sub(6)].PV=data[cmd:sub(6)].PV+1000
  468. end
  469. end
  470. if cmd== "p" then
  471. OpenProfil(n,n)
  472. elseif cmd:sub(0,4) == "lang" then
  473. data[n].lang=cmd:sub(6)
  474. elseif cmd== "help" then
  475. OpenHelp(n)
  476. elseif cmd:sub(0,1) == "p" then
  477. if Dataname(cmd:sub(3)) then
  478. OpenProfil(cmd:sub(3),n)
  479. else
  480. ------------------------------------------------------------chatMessage('error to the profil')--------------------------------------------------------
  481. end
  482. elseif cmd== "shop" then
  483. openshop(n)
  484. elseif cmd=="info" then
  485. OpenInfo(n)
  486. end
  487. end
  488.  
  489. function setPlayerList()
  490. players = {};
  491. for p,_ in pairs (tfm.get.room.playerList) do
  492. table.insert(players, p);
  493. end
  494. return players;
  495. end
  496.  
  497.  
  498. function shuffle(t)
  499. local n = #t;
  500.  
  501. while (n >= 2) do
  502. local k = math.random(n);
  503. t[n], t[k] = t[k], t[n];
  504. n = n - 1;
  505. end
  506.  
  507. return t;
  508. end
  509.  
  510. shuffle(setPlayerList());
  511.  
  512. function eventNewGame()
  513. ui.setMapName(module)
  514. t=0
  515. vampFly= false
  516. canImage= false
  517. ghost = {}
  518. ghost = {players[math.random(#players)]}
  519. king = table.concat(ghost,'\n')
  520. tfm.exec.bindKeyboard(king, '32', true, true)
  521. for n in pairs(tfm.get.room.playerList) do
  522. tfm.exec.setNameColor(n,0x8A8886)
  523. data[n].timee = 0
  524. ui.removeTextArea(448,n);
  525. end
  526. tfm.exec.setGameTime(90)
  527. alive=0
  528. for name,player in pairs(tfm.get.room.playerList) do
  529. alive=alive+1
  530. end
  531. canVamp = false
  532. canVamps = true
  533. canImgvamp = false
  534. end
  535.  
  536. function ghostKing()
  537. tfm.exec.setVampirePlayer(king);
  538. tfm.exec.setNameColor(king,0x0B0B0B)
  539. data[king].vamp=data[king].vamp+1
  540. canImgvamp=true
  541. vampFly=true
  542. end
  543.  
  544. function eventLoop(timePassed, timeLeft)
  545. tt=tt+1
  546. if tt==2 then
  547. for n in pairs(tfm.get.room.playerList) do
  548. if data[n].timee >= 1 then
  549. data[n].timee=data[n].timee-1
  550. ui.addTextArea(448, "<V><p align='center'><B><v><j><font size='12'>"..data[n].timee.."",n,770, 380, 25, 50,0x000001, nil, 0.7,true)
  551. else
  552. ui.removeTextArea(448,n);
  553. end
  554. end
  555. tt=0
  556. end
  557. for n in pairs(tfm.get.room.playerList) do
  558. for keys, k in pairs({70,37,38,39,40,90,32}) do
  559. tfm.exec.bindKeyboard(n, k, true, true)
  560. end
  561. end
  562. if alive == 0 or timeLeft < 1000 then
  563. nextRound();
  564. end
  565. t=t+1
  566. if t==0 then
  567. ui.setMapName(""..module.."<G> | </G><N>The selection of the ghosts after: <V> 10")
  568. elseif t==2 then
  569. ui.setMapName(""..module.."<G> | </G><N>The selection of the ghosts after: <V> 9")
  570. elseif t==4 then
  571. ui.setMapName(""..module.."<G> | </G><N>The selection of the ghosts after: <V> 8")
  572. elseif t==6 then
  573. ui.setMapName(""..module.."<G> | </G><N>The selection of the ghosts after: <V> 7")
  574. elseif t==8 then
  575. ui.setMapName(""..module.."<G> | </G><N>The selection of the ghosts after: <V> 6")
  576. elseif t==10 then
  577. ui.setMapName(""..module.."<G> | </G><N>The selection of the ghosts after: <V> 5")
  578. elseif t==12 then
  579. ui.setMapName(""..module.."<G> | </G><N>The selection of the ghosts after: <V> 4")
  580. elseif t==14 then
  581. ui.setMapName(""..module.."<G> | </G><N>The selection of the ghosts after: <V> 3")
  582. elseif t==16 then
  583. ui.setMapName(""..module.."<G> | </G><N>The selection of the ghosts after: <V> 2")
  584. elseif t==18 then
  585. ui.setMapName(""..module.."<G> | </G><N>The selection of the ghosts after: <V> 1")
  586. elseif t==20 then
  587. ui.setMapName(""..module.."<G> | </G><N>The king Of Ghosts :<J> "..king.."")
  588. elseif t==21 then
  589. canVampss = false
  590. canVamp = true
  591. end
  592. if t==20 then
  593. ghosts = {}
  594. canVampss = true
  595. if canVamps then
  596. if mice<= 5 then
  597. for n in pairs(tfm.get.room.playerList) do
  598. tfm.exec.giveMeep(n)
  599. end
  600. ghostKing()
  601. end
  602. if mice>= 5 then
  603. for n in pairs(tfm.get.room.playerList) do
  604. tfm.exec.giveMeep(n)
  605. end
  606. tfm.exec.setVampirePlayer(players[math.random(#players)]);
  607. end
  608. if mice>= 10 then
  609. tfm.exec.setVampirePlayer(players[math.random(#players)]);
  610. end
  611. if mice>= 15 then
  612. tfm.exec.setVampirePlayer(players[math.random(#players)]);
  613. end
  614. if mice>= 20 then
  615. tfm.exec.setVampirePlayer(players[math.random(#players)]);
  616.  
  617. end
  618. end
  619. end
  620. end
  621.  
  622. function eventPlayerVampire(nv)
  623. if canVampss then
  624. table.insert(ghosts,nv)
  625. end
  626. if canVamp then
  627. data[nv].kill=data[nv].kill+1
  628. for n in pairs(tfm.get.room.playerList) do
  629. if Ghosts(n) then
  630. if tfm.get.room.playerList[n].isDead == true then else
  631. data[n].PV=data[n].PV+PV[math.random(#PV)]
  632. end
  633. end
  634. tfm.exec.chatMessage(getTrans(n,"CHAT_MESSAGE","KILL_MOUSE1")..nv..getTrans(n,"CHAT_MESSAGE","KILL_MOUSE2"),n)
  635. end
  636. tfm.exec.killPlayer(nv)
  637. tfm.exec.displayParticle(13, tfm.get.room.playerList[nv].x, tfm.get.room.playerList[nv].y, 0, 0, 0, 5, nil)
  638. tfm.exec.displayParticle(13, tfm.get.room.playerList[nv].x, tfm.get.room.playerList[nv].y, 0, 0, 5, 0, nil)
  639. tfm.exec.displayParticle(13, tfm.get.room.playerList[nv].x, tfm.get.room.playerList[nv].y, 0, 0, 0, -5, nil)
  640. tfm.exec.displayParticle(13, tfm.get.room.playerList[nv].x, tfm.get.room.playerList[nv].y, 0, 0, -5, 0, nil)
  641. end
  642. end
  643.  
  644.  
  645. function nextRound()
  646. tfm.exec.newGame(maps[math.random(#maps)]);
  647. end
  648.  
  649. function eventPlayerDied(name)
  650. local i=0
  651. local n
  652. for pname,player in pairs(tfm.get.room.playerList) do
  653. if not player.isDead then
  654. i=i+1
  655. n=pname
  656. end
  657. end
  658. if i==0 then
  659. tfm.exec.newGame(maps[math.random(#maps)])
  660. elseif i==1 then
  661. tfm.exec.setGameTime(20)
  662. end
  663. end
  664.  
  665. function eventPlayerWon(n, timeElapsed, timeElapsedSinceRespawn )
  666. time= timeElapsed/100
  667. for name in pairs(tfm.get.room.playerList) do
  668. tfm.exec.chatMessage(getTrans(n,"CHAT_MESSAGE","WON_MOUSE1")..n..getTrans(n,"CHAT_MESSAGE","WON_MOUSE2"),name)
  669. end
  670. data[n].won=data[n].won+1
  671. data[n].PV=data[n].PV+16
  672. data[n].timee = 0
  673. end
  674.  
  675. function eventPlayerLeft(name)
  676. players = {};
  677. mice=mice-1
  678. for p,_ in pairs(tfm.get.room.playerList) do
  679. table.insert(players, p);
  680. end
  681. end
  682.  
  683. tfm.exec.newGame(maps[math.random(#maps)]);
  684.  
  685. --tfm.get.room.playerList[n].tribeName
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement