Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- TEXT1=' <J>Witaj w minigrze Boxing!\n\n<BV>Cel: <N>Pokonaj wszystkie myszy na mapie aby wygrać.\n\n<BV>Komendy:\n<BL>!pomoc\t\t<N>- wyświetla to co teraz czytasz...\n<BL>!info\t\t<N>- wyświetla informacje na temat minigry\n<BL>!mort\t\t<N>- samobójstwo'
- TEXT2=' <J>Informacje o Boxing\n\n<BV>Autor: <V>Grejfrutek\n<BV>Twórca: <V>Ouake\n\n<BV>Ilość map: <N>10\n\n<BV>Sterowanie:\n<VP>Spacja\t<N>- latanie\n<VP>B\t\t<N>- atak\n<VP>N\t\t<N>- blok'
- tfm.exec.disableAutoScore(true)
- tfm.exec.disableAutoShaman(true)
- tfm.exec.disableAutoNewGame(true)
- system.disableChatCommandDisplay("info",true)
- system.disableChatCommandDisplay("mort",true)
- system.disableChatCommandDisplay("pomoc",true)
- Mapy={281492,293487,296033,305753,307930,479091,292672,3107377,3295213,3400319}
- tfm.exec.newGame(Mapy[math.random(#Mapy)])
- function eventNewGame()
- HP,kier,blok,t1,t2,i={},{},{},{},{},0
- ui.removeTextArea(3)
- ui.removeTextArea(10)
- ui.removeTextArea(11)
- for nick in pairs(tfm.get.room.playerList) do
- ui.addTextArea(1,"<B><G>♥♥♥♥♥♥♥♥♥♥",nick,84,30)
- ui.addTextArea(2,"<B><J>Zdrowie: <VP>♥♥♥♥♥♥♥♥♥♥",nick,20,30,0,0,0)
- tfm.exec.setNameColor(nick,0)
- for v,klaw in pairs({32,66,68,78,81}) do
- tfm.exec.bindKeyboard(nick,klaw,true,true)
- end
- HP[nick],kier[nick],blok[nick],t1[nick],t2[nick],i=10,10,0,0,0,i+1
- end
- end
- function eventKeyboard(nick,klaw)
- if klaw==32 then
- tfm.exec.movePlayer(nick,0,0,true,0,-50,true)
- elseif klaw==66 then
- Zly=nick
- if t2[nick]==0 then
- --*Pole ataku:* ui.addTextArea(666,"",nick,tfm.get.room.playerList[nick].x+kier[nick],tfm.get.room.playerList[nick].y-30,40,60,0xff0000,0xff0000,0.5)
- Atak()
- end
- t2[nick]=1
- elseif klaw==78 then
- blok[nick]=1
- ui.addTextArea(3,"",nick,tfm.get.room.playerList[nick].x-20,tfm.get.room.playerList[nick].y-20,40,40,0xffff00,0xffff00,0.5)
- elseif klaw==68 then kier[nick]=10
- elseif klaw==81 then kier[nick]=-50
- end
- end
- function Atak()
- for nick in pairs(tfm.get.room.playerList) do
- if tfm.get.room.playerList[nick].x>tfm.get.room.playerList[Zly].x+kier[nick] and tfm.get.room.playerList[nick].x<tfm.get.room.playerList[Zly].x+50+kier[nick] and tfm.get.room.playerList[nick].y>tfm.get.room.playerList[Zly].y-35 and tfm.get.room.playerList[nick].y<tfm.get.room.playerList[Zly].y+35 then
- if HP[nick]>0 and blok[nick]==0 then
- Obj=tfm.exec.addShamanObject(1,tfm.get.room.playerList[nick].x+kier[nick],tfm.get.room.playerList[nick].y)
- tfm.exec.removeObject(Obj)
- ui.addTextArea(10,"<B><font color='#ff9b29'>"..Zly.." właśnie Cię uderzył!",nick,tfm.get.room.playerList[nick].x-90,tfm.get.room.playerList[nick].y-80,0,0,0x1c3c41,0x1c3c41,0.7)
- HP[nick],t1[nick],THP=HP[nick]-1,6,"<B><J>Zdrowie: <VP>"
- for i=1,HP[nick] do
- THP=THP.."♥"
- end
- if HP[nick]==3 then
- tfm.exec.setNameColor(nick,0xff9e9e)
- ui.addTextArea(11,"<B><font color='#ff9e9e'>Masz mało serc!",nick,tfm.get.room.playerList[nick].x-50,tfm.get.room.playerList[nick].y-100,0,0,0x1c3c41,0x1c3c41,0.7)
- t1[nick]=6
- end
- if HP[nick]==0 then
- tfm.exec.killPlayer(nick)
- ui.addTextArea(10,"<B><font color='#ffaa29'>"..Zly.." pokonał Ciebie!",nick,tfm.get.room.playerList[nick].x-70,tfm.get.room.playerList[nick].y-80,0,0,0x1c3c41,0x1c3c41,0.7)
- end
- ui.addTextArea(2,THP,nick,20,30,0,0,0)
- elseif HP[nick]>0 and blok[nick]==1 then
- ui.addTextArea(10,"<B><font color='#a3ffff'>Zdołałeś/aś zablokować atak.",nick,tfm.get.room.playerList[nick].x-95,tfm.get.room.playerList[nick].y-80,0,0,0x1c3c41,0x1c3c41,0.7)
- t1[nick]=6
- end
- end
- end
- end
- function eventChatCommand(nick,komd)
- if komd=="pomoc" then
- ui.addTextArea(101,TEXT1,nick,230,110,340,200,0x1c3c41,0x1c3c41,1)
- ui.addTextArea(102,'<B><R><a href="event:klik1">X</a>',nick,550,110,14,18,nil,nil,0)
- elseif komd=="info" then
- ui.addTextArea(101,TEXT2,nick,230,110,340,200,0x1c3c41,0x1c3c41,1)
- ui.addTextArea(102,'<B><R><a href="event:klik1">X</a>',nick,550,110,14,18,nil,nil,0)
- elseif komd=="mort" then
- tfm.exec.killPlayer(nick)
- end
- end
- function eventTextAreaCallback(id,playerName,odp)
- for nick in pairs(tfm.get.room.playerList) do
- if odp=="klik1" then
- ui.removeTextArea(101,nick)
- ui.removeTextArea(102,nick)
- end
- end
- end
- function eventLoop(v,czas)
- for nick in pairs(tfm.get.room.playerList) do
- if t1[nick]==1 then
- ui.removeTextArea(10,nick)
- ui.removeTextArea(11,nick)
- t1[nick]=t1[nick]-1
- elseif t1[nick]>1 then
- t1[nick]=t1[nick]-1
- end
- if t2[nick]>0 then
- t2[nick]=0
- end
- if blok[nick]==1 then
- ui.removeTextArea(3,nick)
- blok[nick]=0
- end
- end
- if czas<1 then
- tfm.exec.newGame(Mapy[math.random(#Mapy)])
- end
- end
- function eventPlayerDied(nick)
- ui.addTextArea(2,"<B><J>Zdrowie: ",nick,20,30,0,0,0)
- HP[nick],i=0,i-1
- for nick,player in pairs(tfm.get.room.playerList) do
- if player.isDead==false and i==1 then
- tfm.exec.setPlayerScore(nick,1,true)
- end
- end
- if i==0 then
- tfm.exec.newGame(Mapy[math.random(#Mapy)])
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement