Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- id = {}
- data={}
- ghost = {}
- ghosts = {}
- dataname = {}
- mice=0
- t=0
- tt=0
- POINTS_SKILL1=500
- POINTS_SKILL2=1500
- POINTS_SKILL3=2500
- POINTS_PLAYERS=0
- module="<font color='#797979'>#Ghost"
- tfm.exec.disableAutoShaman(true);
- tfm.exec.disableAutoNewGame(true);
- maps = {425030,2076632,7240046,7240054,198715,332210,391831}
- --maps = {,3854268,7239970,2796001,}
- --maps = {244699,475151,7240059,350251}
- PV = {7,8,9,10,11,13}
- system.disableChatCommandDisplay("give", true)
- function Ghost(n)
- for i,ghost in ipairs(ghost) do
- if n==ghost then
- return true
- end
- end
- return false
- end
- function Ghosts(n)
- for i,ghosts in ipairs(ghosts) do
- if n==ghosts then
- return true
- end
- end
- return false
- end
- function Dataname(n)
- for i,dataname in ipairs(dataname) do
- if n==dataname then
- return true
- end
- end
- return false
- end
- TextArea = function(n,id)
- if id then
- if id == 1 then
- ui.removeTextArea(446,n);
- ui.removeTextArea(445,n);
- ui.removeTextArea(444,n);
- ui.removeTextArea(443,n);
- 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)
- elseif id == 2 then
- 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)
- 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)
- 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)
- 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)
- 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)
- end
- end
- end
- function addData(n)
- 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}
- end
- function eventNewPlayer(n)
- mice=mice+1
- players = {};
- for p,_ in pairs (tfm.get.room.playerList) do
- table.insert(players,n);
- end
- if Dataname(n) then else
- addData(n)
- table.insert(dataname,n)
- end
- tfm.exec.chatMessage(getTrans(n,"CHAT_MESSAGE","WELCOME"),n)
- TextArea(n,1)
- end
- translation = {
- ar = {
- CHAT_MESSAGE = {
- 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>قم بكتابة",
- ERROR_TIME_USE = "<r>يمكنك استعمال هذه الاداة فقط مرة واحدة كل 20 ثانية",
- ERROR_BUY_SKIILS = "<r>لا تملك النقاط الكافية لشراء هذه الاداة",
- USE_SKILL_1 = "في وضعية الاستخدام <j>Spirit</j> تم وضع<br>لإستعمالها <j>[F]</j> اضغط",
- USE_SKILL_2 = "في وضعية الاستخدام <j>Speed</j> تم وضع<br>لإستعمالها <j>[F]</j> اضغط",
- USE_SKILL_3 = "في وضعية الاستخدام <j>Acrobat</j> تم وضع<br>لإستعمالها <j>[F]</j> اضغط",
- WON_MOUSE1= "<J>الهرب من الأشباح <v>",
- WON_MOUSE2= "</v>إستطاع",
- KILL_MOUSE1 = "<R>على يد الأشباح <v>",
- KILL_MOUSE2 = "</v> قُتل",
- },
- INFO = {
- TITLE = "<b><font size='20'>معلومات</font></b>",
- TEXT = "<br><p align='right'><font size='13'>Mmmm123 , Turkitutu<j> : بواسطة</j><br><j> : طاقم الخرائط </j></font><br><font size='11'> Dfdskjfhaifs , Boucharma </p>",
- },
- SHOP = {
- TITLE = "<font size='20'>متجر",
- TITLE_SKILL_1 = "فرقعة",
- TITLE_SKILL_2 = "سرعة",
- TITLE_SKILL_3 = "إختراق",
- EQUIP_SKILL_1 = "<j><font size='10'><a href='event:item_skill1'>إرتداء",
- EQUIP_SKILL_2 = "<j><font size='10'><a href='event:item_skill2'>إرتداء",
- EQUIP_SKILL_3 = "<j><font size='10'><a href='event:item_skill3'>إرتداء",
- UNEQIIP_SKILL = "<font size='10'><v>تم إرتداءه",
- },
- PROFIL = {
- TEXT1="<p align='right'><font size='14'><br><v>",
- TEXT2=" <n>: عدد مرات النجاة<br><br><v>",
- TEXT3=" <n>: عدد مرات الموت<br><br><v>",
- TEXT4=" <n>: عدد مرات القيادة<br><br><br><p align='center'><j>",
- TEXT5=" <n>: المجتمع",
- },
- HELP = {
- TITLE = "<b><font size='20'>مساعدة</font></b>",
- 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>.من بين كل الاشباح ألذي معك ",
- },
- TEXT_AREA = {
- CLASE ="اغلاق النافذة",
- },
- },
- en = {
- CHAT_MESSAGE = {
- 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>",
- ERROR_TIME_USE = "<r>You can use this tool one time for every round",
- ERROR_BUY_SKIILS = "<r>You don't have enough points to buy this item",
- USE_SKILL_1 = "<j>Spirit</j> has been added in use position<br>For use it press <j>[F]</j>",
- USE_SKILL_2 = "<j>Speed</j> has been added in use position<br>For use it press <j>[F]</j>",
- USE_SKILL_3 = "<j>Acrobat</j> has been added in use position<br>For use it press <j>[F]</j>",
- WON_MOUSE1 = "<v>",
- WON_MOUSE2 = " <j>can escape and enter the hole",
- KILL_MOUSE1 = "<v>",
- KILL_MOUSE2 = " <r>has been died by ghosts." ,
- },
- INFO = {
- TITLE = "<b><font size='20'>Info</font></b>",
- 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>",
- },
- SHOP = {
- TITLE = "<font size='20'>Shop",
- TITLE_SKILL_1 = "Spirit",
- TITLE_SKILL_2 = "Speed",
- TITLE_SKILL_3 = "Acrobat",
- EQUIP_SKILL_1 = "<j><font size='10'><a href='event:item_skill1'>Equip",
- EQUIP_SKILL_2 = "<j><font size='10'><a href='event:item_skill2'>Equip",
- EQUIP_SKILL_3 = "<j><font size='10'><a href='event:item_skill3'>Equip",
- UNEQIIP_SKILL = "<font size='10'><v>Unequip",
- },
- PROFIL = {
- TEXT1="<font size='14'><br><n>Total Escape : <v>",
- TEXT2=" <br><br><n>Total death : <v>",
- TEXT3=" <br><br><n>Total King Ghosts : <v>",
- TEXT4=" <br><br><br><p align='center'><n>Community : <j>",
- TEXT5="",
- },
- HELP = {
- TITLE = "<b><font size='20'>Help</font></b>",
- 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.",
- },
- TEXT_AREA = {
- CLASE ="Close",
- },
- },
- }
- for n,player in pairs(tfm.get.room.playerList) do
- mice=mice+1
- addData(n)
- TextArea(n,1)
- table.insert(dataname,n)
- end
- getTrans = function(n,id1,id2)
- for n in pairs (tfm.get.room.playerList) do
- if translation[data[n].lang] then
- return translation[data[n].lang][id1][id2]
- else
- return translation["en"][id1][id2]
- end
- end
- end
- function eventKeyboard(n, key, down, x, y)
- if key == 38 then
- if Ghost(n) then
- if vampFly then
- tfm.exec.movePlayer(n,0,0,false,0,-40,false)
- end
- end
- elseif key == 37 then
- if canImgvamp then
- if Ghost(n) then
- tfm.exec.removeImage(id[n])
- id[n] = tfm.exec.addImage("157f3259f31.png", "%"..n, -35, -50) -- ←
- end
- end
- elseif key == 39 then
- if canImgvamp then
- if Ghost(n) then
- tfm.exec.removeImage(id[n])
- id[n] = tfm.exec.addImage("157f325dcc3.png", "%"..n, -35, -50) -- →
- end
- end
- elseif key == 90 then
- if Ghost(n) then
- if vampFly then
- tfm.exec.movePlayer(n,0,0,false,0,-40,false)
- end
- end
- elseif key == 32 then
- if Ghost(n) then
- if vampFly then
- tfm.exec.movePlayer(n,0,0,false,0,-40,false)
- end
- end
- elseif key == 70 then
- if data[n].timee <= 0 then
- if data[n].item == "skill1" then
- tfm.exec.displayParticle(12,x,y+30)
- tfm.exec.movePlayer(n,0,0,true,0,-100,false)
- data[n].timee = 21
- elseif data[n].item == "skill2" then
- if tfm.get.room.playerList[n].isFacingRight then
- tfm.exec.displayParticle(26,x+20,y)
- tfm.exec.displayParticle(26,x+30,y)
- tfm.exec.displayParticle(26,x+40,y)
- tfm.exec.displayParticle(26,x+50,y)
- tfm.exec.movePlayer(n,0,0,true,100,0,false)
- data[n].timee = 21
- else
- tfm.exec.displayParticle(26,x-20,y)
- tfm.exec.displayParticle(26,x-30,y)
- tfm.exec.displayParticle(26,x-40,y)
- tfm.exec.displayParticle(26,x-50,y)
- tfm.exec.movePlayer(n,0,0,true,-100,0,false)
- data[n].timee = 21
- end
- elseif data[n].item == "skill3" then
- if tfm.get.room.playerList[n].isFacingRight then
- tfm.exec.displayParticle(35,x+20,y,0,0,0,0)
- tfm.exec.movePlayer(n,x+65,0)
- data[n].timee = 21
- else
- tfm.exec.displayParticle(35,x-20,y,0,0,0,0)
- tfm.exec.movePlayer(n,x-65,0)
- data[n].timee = 21
- end
- end
- else
- tfm.exec.chatMessage(getTrans(n,"CHAT_MESSAGE","ERROR_TIME_USE"),n)
- end
- end
- end
- removeshopp = function(n,id)
- ui.removeTextArea(9 ..id.. 3621,n);
- ui.removeTextArea(9 ..id.. 3622,n);
- ui.removeTextArea(9 ..id.. 3623,n);
- ui.removeTextArea(9 ..id.. 3624,n);
- ui.removeTextArea(9 ..id.. 3625,n);
- ui.removeTextArea(9 ..id.. 3626,n);
- ui.removeTextArea(9 ..id.. 3627,n);
- ui.removeTextArea(9 ..id.. 3628,n);
- ui.removeTextArea(9 ..id.. 3629,n);
- ui.removeTextArea(9 ..id.. 3630,n);
- ui.removeTextArea(9 ..id.. 3631,n);
- end
- twf = {
- ui = {
- popups = {},
- createPopup = function(id, title,tt, text, player, buttons, closable,shopbt,textbt, x, y, w, h, alpha, U)
- if tt== true then
- tt=" _______________________<br>"
- end
- if tt== false then
- tt=""
- end
- ui.addTextArea(9 ..id.. 36 .. 21, "",player,x+-2,y+18,w+24,h+14,0x2E221B,0x2E221B,alpha,true);
- ui.addTextArea(9 ..id.. 36 .. 22, "",player,x+-1,y+19,w+22,h+12,0x986742,0x986742,alpha,true);
- ui.addTextArea(9 ..id.. 36 .. 23, "",player,x+2,y+22,w+16,h+6,0x171311,0x171311,alpha,true);
- ui.addTextArea(9 ..id.. 36 .. 24, "",player,x+3,y+23,w+14,h+4,0x0C191C,0x0C191C,alpha,true);
- ui.addTextArea(9 ..id.. 36 .. 25, "",player,x+4,y+24,w+12,h+2,0x24474D,0x24474D,alpha,true);
- ui.addTextArea(9 ..id.. 36 .. 26, "",player,x+5,y+25,w+10,h+0,0x183337,0x183337,alpha,true);
- 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);
- if closable then
- ui.addTextArea(9 ..id.. 36 .. 28, "",player,x+15,y+h-20+25,w-10,15,0x5D7D90,0x5D7D90,alpha,true);
- ui.addTextArea(9 ..id.. 36 .. 29, "",player,x+15,y+h-20+27,w-10,15,0x11171C,0x11171C,alpha,true);
- 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);
- end;
- if shopbt then
- ui.addTextArea(9 ..id.. 36 .. 28, "",player,x+15,y+h-20+25,w-10,15,0x5D7D90,0x5D7D90,alpha,true);
- ui.addTextArea(9 ..id.. 36 .. 29, "",player,x+15,y+h-20+27,w-10,15,0x11171C,0x11171C,alpha,true);
- ui.addTextArea(9 ..id.. 36 .. 30, "<p align='center'>"..textbt.."", player,x+15,y+h-20+26,w-10,15,0x3C5064,0x3C5064,alpha,true);
- end;
- twf.ui.popups[tostring("9"..id.."36")] = 9 ..id.. 36;
- end,
- removePopup = function(id, player) -- Define the var as a function.
- ui.removeTextArea(twf.ui.popups[id] .. 21, player);
- ui.removeTextArea(twf.ui.popups[id] .. 22, player);
- ui.removeTextArea(twf.ui.popups[id] .. 23, player);
- ui.removeTextArea(twf.ui.popups[id] .. 24, player);
- ui.removeTextArea(twf.ui.popups[id] .. 25, player);
- ui.removeTextArea(twf.ui.popups[id] .. 26, player);
- ui.removeTextArea(twf.ui.popups[id] .. 27, player);
- ui.removeTextArea(twf.ui.popups[id] .. 28, player);
- ui.removeTextArea(twf.ui.popups[id] .. 29, player);
- ui.removeTextArea(twf.ui.popups[id] .. 30, player);
- end,
- createLabel = function(id, text, player, x, y)
- ui.addTextArea(9 ..id.. 72 .. 22, "<font color='#000000' size='14'>"..text.."</font>", player, x - 1, y, 600, 20, nil, nil, 0.0, true);
- ui.addTextArea(9 ..id.. 72 .. 22, "<font color='#000000' size='14'>"..text.."</font>", player, x + 1, y, 600, 20, nil, nil, 0.0, true);
- ui.addTextArea(9 ..id.. 72 .. 22, "<font color='#000000' size='14'>"..text.."</font>", player, x, y - 1, 600, 20, nil, nil, 0.0, true);
- ui.addTextArea(9 ..id.. 72 .. 22, "<font color='#000000' size='14'>"..text.."</font>", player, x, y + 1, 600, 20, nil, nil, 0.0, true);
- ui.addTextArea(9 ..id.. 72 .. 21, "<font color='#ffffff' size='14'>"..text.."</font>", player, x, y, 600, 20, nil, nil, 0.0, true);
- end
- },
- trigger = {
- popupClose = function(popupId, playerName, callback)
- if string.sub(callback, 0, 14) == "closeTWFPopup_" then
- twf.ui.removePopup(callback:sub(15), playerName);
- removeshopp(playerName,2)
- removeshopp(playerName,3)
- removeshopp(playerName,4)
- removeshopp(playerName,5)
- removeshopp(playerName,6)
- ui.removeTextArea(8764524789,playerName);
- end
- end;
- }
- }
- function openshop(n)
- twf.ui.createPopup(2,"",false,"",n,"",false,false,"", 120,75, 100, 200, 1, true)
- twf.ui.createPopup(1,getTrans(n,"SHOP","TITLE"),"<r>__________________","",n,"",true,false,"", 210,50, 390, 250, 1, true)
- 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)
- if data[n].skill1 == "false" then
- 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)
- elseif data[n].skill1 == "true" then
- if data[n].item == "skill1" then
- 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)
- else
- 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)
- end
- end
- if data[n].skill2 == "false" then
- 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)
- elseif data[n].skill2 == "true" then
- if data[n].item == "skill2" then
- 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)
- else
- 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)
- end
- end
- if data[n].skill3 == "false" then
- 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)
- elseif data[n].skill3 == "true" then
- if data[n].item == "skill3" then
- 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)
- else
- 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)
- end
- end
- end
- function OpenProfil(ProfilName,n)
- 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)
- end
- function OpenHelp(n)
- if data[n].lang == "ar" then
- twf.ui.createPopup(1,getTrans(n,"HELP","TITLE"),true,"",n, buttonsArray, true,false,"", 210, 65, 352, 260, 1, true)
- ui.addTextArea(8764524789,getTrans(n,"HELP","TEXT"),n, 240, 145, 335, 180, 0x000001, nil, 0.0,true)
- else
- twf.ui.createPopup(1,getTrans(n,"HELP","TITLE"),true,getTrans(n,"HELP","TEXT"),n, buttonsArray, true,false,"", 210, 65, 352, 270, 1, true)
- end
- end
- function OpenInfo(n)
- twf.ui.createPopup(1,getTrans(n,"INFO","TITLE"),true,getTrans(n,"INFO","TEXT"),n, buttonsArray, true,false,"", 210,70, 350, 190, 1, true)
- end
- function eventTextAreaCallback(textAreaId,n, callback)
- twf.trigger.popupClose(textAreaId,n, callback);
- if callback=="help" then
- OpenHelp(n)
- elseif callback=="info" then
- OpenInfo(n)
- elseif callback=="profil" then
- OpenProfil(n,n)
- elseif callback=="shop" then
- openshop(n)
- elseif callback=="openArea" then
- TextArea(n,2)
- elseif callback=="claseArea" then
- TextArea(n,1)
- elseif callback=="shop_skill1" then
- if data[n].PV >= POINTS_SKILL1 then
- data[n].PV=data[n].PV-POINTS_SKILL1
- data[n].skill1= "true"
- openshop(n)
- else
- openshop(n)
- tfm.exec.chatMessage(getTrans(n,"CHAT_MESSAGE","ERROR_BUY_SKIILS"),n)
- end
- elseif callback=="shop_skill2" then
- if data[n].PV >= POINTS_SKILL2 then
- data[n].PV=data[n].PV-POINTS_SKILL2
- data[n].skill2= "true"
- openshop(n)
- else
- openshop(n)
- tfm.exec.chatMessage(getTrans(n,"CHAT_MESSAGE","ERROR_BUY_SKIILS"),n)
- end
- elseif callback=="shop_skill3" then
- if data[n].PV >= POINTS_SKILL3 then
- data[n].PV=data[n].PV-POINTS_SKILL3
- data[n].skill3= "true"
- openshop(n)
- else
- openshop(n)
- tfm.exec.chatMessage(getTrans(n,"CHAT_MESSAGE","ERROR_BUY_SKIILS"),n)
- end
- elseif callback=="item_skill1" then
- data[n].item = "skill1"
- openshop(n)
- tfm.exec.chatMessage(getTrans(n,"CHAT_MESSAGE","USE_SKILL_1"),n)
- print(getTrans(n,"CHAT_MESSAGE","USE_SKILL_1"))
- elseif callback=="item_skill2" then
- data[n].item = "skill2"
- openshop(n)
- tfm.exec.chatMessage(getTrans(n,"CHAT_MESSAGE","USE_SKILL_2"),n)
- elseif callback=="item_skill3" then
- data[n].item = "skill3"
- openshop(n)
- tfm.exec.chatMessage(getTrans(n,"CHAT_MESSAGE","USE_SKILL_3"),n)
- end
- end
- buttonsArray = "";
- function eventChatCommand(n,cmd)
- if cmd:sub(0,4) == "give" then
- if n== "Mmmm123" then
- data[cmd:sub(6)].PV=data[cmd:sub(6)].PV+1000
- end
- end
- if cmd== "p" then
- OpenProfil(n,n)
- elseif cmd:sub(0,4) == "lang" then
- data[n].lang=cmd:sub(6)
- elseif cmd== "help" then
- OpenHelp(n)
- elseif cmd:sub(0,1) == "p" then
- if Dataname(cmd:sub(3)) then
- OpenProfil(cmd:sub(3),n)
- else
- ------------------------------------------------------------chatMessage('error to the profil')--------------------------------------------------------
- end
- elseif cmd== "shop" then
- openshop(n)
- elseif cmd=="info" then
- OpenInfo(n)
- end
- end
- function setPlayerList()
- players = {};
- for p,_ in pairs (tfm.get.room.playerList) do
- table.insert(players, p);
- end
- return players;
- end
- function shuffle(t)
- local n = #t;
- while (n >= 2) do
- local k = math.random(n);
- t[n], t[k] = t[k], t[n];
- n = n - 1;
- end
- return t;
- end
- shuffle(setPlayerList());
- function eventNewGame()
- ui.setMapName(module)
- t=0
- vampFly= false
- canImage= false
- ghost = {}
- ghost = {players[math.random(#players)]}
- king = table.concat(ghost,'\n')
- tfm.exec.bindKeyboard(king, '32', true, true)
- for n in pairs(tfm.get.room.playerList) do
- tfm.exec.setNameColor(n,0x8A8886)
- data[n].timee = 0
- ui.removeTextArea(448,n);
- end
- tfm.exec.setGameTime(90)
- alive=0
- for name,player in pairs(tfm.get.room.playerList) do
- alive=alive+1
- end
- canVamp = false
- canVamps = true
- canImgvamp = false
- end
- function ghostKing()
- tfm.exec.setVampirePlayer(king);
- tfm.exec.setNameColor(king,0x0B0B0B)
- data[king].vamp=data[king].vamp+1
- canImgvamp=true
- vampFly=true
- end
- function eventLoop(timePassed, timeLeft)
- tt=tt+1
- if tt==2 then
- for n in pairs(tfm.get.room.playerList) do
- if data[n].timee >= 1 then
- data[n].timee=data[n].timee-1
- 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)
- else
- ui.removeTextArea(448,n);
- end
- end
- tt=0
- end
- for n in pairs(tfm.get.room.playerList) do
- for keys, k in pairs({70,37,38,39,40,90,32}) do
- tfm.exec.bindKeyboard(n, k, true, true)
- end
- end
- if alive == 0 or timeLeft < 1000 then
- nextRound();
- end
- t=t+1
- if t==0 then
- ui.setMapName(""..module.."<G> | </G><N>The selection of the ghosts after: <V> 10")
- elseif t==2 then
- ui.setMapName(""..module.."<G> | </G><N>The selection of the ghosts after: <V> 9")
- elseif t==4 then
- ui.setMapName(""..module.."<G> | </G><N>The selection of the ghosts after: <V> 8")
- elseif t==6 then
- ui.setMapName(""..module.."<G> | </G><N>The selection of the ghosts after: <V> 7")
- elseif t==8 then
- ui.setMapName(""..module.."<G> | </G><N>The selection of the ghosts after: <V> 6")
- elseif t==10 then
- ui.setMapName(""..module.."<G> | </G><N>The selection of the ghosts after: <V> 5")
- elseif t==12 then
- ui.setMapName(""..module.."<G> | </G><N>The selection of the ghosts after: <V> 4")
- elseif t==14 then
- ui.setMapName(""..module.."<G> | </G><N>The selection of the ghosts after: <V> 3")
- elseif t==16 then
- ui.setMapName(""..module.."<G> | </G><N>The selection of the ghosts after: <V> 2")
- elseif t==18 then
- ui.setMapName(""..module.."<G> | </G><N>The selection of the ghosts after: <V> 1")
- elseif t==20 then
- ui.setMapName(""..module.."<G> | </G><N>The king Of Ghosts :<J> "..king.."")
- elseif t==21 then
- canVampss = false
- canVamp = true
- end
- if t==20 then
- ghosts = {}
- canVampss = true
- if canVamps then
- if mice<= 5 then
- for n in pairs(tfm.get.room.playerList) do
- tfm.exec.giveMeep(n)
- end
- ghostKing()
- end
- if mice>= 5 then
- for n in pairs(tfm.get.room.playerList) do
- tfm.exec.giveMeep(n)
- end
- tfm.exec.setVampirePlayer(players[math.random(#players)]);
- end
- if mice>= 10 then
- tfm.exec.setVampirePlayer(players[math.random(#players)]);
- end
- if mice>= 15 then
- tfm.exec.setVampirePlayer(players[math.random(#players)]);
- end
- if mice>= 20 then
- tfm.exec.setVampirePlayer(players[math.random(#players)]);
- end
- end
- end
- end
- function eventPlayerVampire(nv)
- if canVampss then
- table.insert(ghosts,nv)
- end
- if canVamp then
- data[nv].kill=data[nv].kill+1
- for n in pairs(tfm.get.room.playerList) do
- if Ghosts(n) then
- if tfm.get.room.playerList[n].isDead == true then else
- data[n].PV=data[n].PV+PV[math.random(#PV)]
- end
- end
- tfm.exec.chatMessage(getTrans(n,"CHAT_MESSAGE","KILL_MOUSE1")..nv..getTrans(n,"CHAT_MESSAGE","KILL_MOUSE2"),n)
- end
- tfm.exec.killPlayer(nv)
- tfm.exec.displayParticle(13, tfm.get.room.playerList[nv].x, tfm.get.room.playerList[nv].y, 0, 0, 0, 5, nil)
- tfm.exec.displayParticle(13, tfm.get.room.playerList[nv].x, tfm.get.room.playerList[nv].y, 0, 0, 5, 0, nil)
- tfm.exec.displayParticle(13, tfm.get.room.playerList[nv].x, tfm.get.room.playerList[nv].y, 0, 0, 0, -5, nil)
- tfm.exec.displayParticle(13, tfm.get.room.playerList[nv].x, tfm.get.room.playerList[nv].y, 0, 0, -5, 0, nil)
- end
- end
- function nextRound()
- tfm.exec.newGame(maps[math.random(#maps)]);
- end
- function eventPlayerDied(name)
- local i=0
- local n
- for pname,player in pairs(tfm.get.room.playerList) do
- if not player.isDead then
- i=i+1
- n=pname
- end
- end
- if i==0 then
- tfm.exec.newGame(maps[math.random(#maps)])
- elseif i==1 then
- tfm.exec.setGameTime(20)
- end
- end
- function eventPlayerWon(n, timeElapsed, timeElapsedSinceRespawn )
- time= timeElapsed/100
- for name in pairs(tfm.get.room.playerList) do
- tfm.exec.chatMessage(getTrans(n,"CHAT_MESSAGE","WON_MOUSE1")..n..getTrans(n,"CHAT_MESSAGE","WON_MOUSE2"),name)
- end
- data[n].won=data[n].won+1
- data[n].PV=data[n].PV+16
- data[n].timee = 0
- end
- function eventPlayerLeft(name)
- players = {};
- mice=mice-1
- for p,_ in pairs(tfm.get.room.playerList) do
- table.insert(players, p);
- end
- end
- tfm.exec.newGame(maps[math.random(#maps)]);
- --tfm.get.room.playerList[n].tribeName
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement