Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- roles={0,1}
- maps={7489629}
- data={}
- text={}
- lang={}
- players={}
- lang.en={
- menu="Menu",
- profile2="Profile",
- help2="Help",
- help="In #bombdeliver",
- points="Points",
- close="Close",
- health=100
- }
- for _, s in next, {'AutoTimeLeft', 'PhysicalConsumables', 'AfkDeath', 'AutoShaman', 'AutoNewGame'} do
- tfm.exec['disable' .. s]()
- end
- function identifyBomber(n)
- if data[n].role==0 then
- tfm.exec.setNameColor(n,0x00FF00)
- elseif data[n].role==1 then
- tfm.exec.setNameColor(n,0xFF0000)
- end
- end
- function insertName(n)
- table.insert(players,n)
- end
- function setLang(n)
- text[n]=lang[tfm.get.room.playerList[n].community] or lang.en
- end
- function setData(n)
- data[n]=
- {
- points=0,
- role=0,
- health=100
- }
- end
- function chooseRole()
- for n,player in pairs(tfm.get.room.playerList) do
- data[n].role=0
- end
- player=players[math.random(#players)]
- data[player].role=1
- player=""..player
- end
- function bindKeyboard(n)
- for i=0,100 do
- tfm.exec.bindKeyboard(n,i,true,true)
- end
- end
- function showMenu(n)
- ui.addTextArea(0, "<p align='center'><font face='calibri'><a href='event:menu2'>"..text[n].menu, n, 10, 30, 42, 20, 0x000001, 0xFFFFFF, 1, true)
- end
- function showMenu2(n)
- ui.addTextArea(0, "<p align='center'><font face='calibri'><a href='event:Menu'>"..text[n].menu.." </a>| <a href='event:Help'>"..text[n].help2.."</a> | <a href='event:Profile'>"..text[n].profile2, n, 10, 30, 121, 20, 0x000001, 0xffffff, 1, true)
- end
- function showHealth(n)
- ui.addTextArea(-3, "", n, 319, 27, 100, 18, 0xffffff, 0xffffff, 1, true)
- ui.addTextArea(-1, "", n, 319, 27, data[n].health, 18, 0x1aff00, 0x1aff00, 1, true)
- ui.addTextArea(-2, "<p align='center'><b><font color='#000000'>"..data[n].health.."%", n, 345, 27, 54, 18, 0x324650, 0x000000, 0, true)
- end
- function displayTab(n,info,subject)
- ui.addTextArea(2, "", n, 262, 72, 360, 290, 0x331f15, 0x331f15, 1, true)
- ui.addTextArea(3, "", n, 262, 125, 4, 180, 0x6b4231, 0x6b4231, 1, true)
- ui.addTextArea(5, "", n, 295, 72, 290, 4, 0x6b4231, 0x6b4231, 1, true)
- ui.addTextArea(4, "", n, 618, 125, 4, 180, 0x6b4231, 0x6b4231, 1, true)
- ui.addTextArea(6, "", n, 295, 358, 295, 4, 0x6b4231, 0x6b4231, 1, true)
- ui.addTextArea(1, "<p align='center'><font face='calibri'><font size='17'><b>#BOMBDELIVER - "..subject.."</b></font></font><font size='14'>\n\n"..info, n, 271, 80, 342, 270, 0x1b262b, 0x131c21, 1, true)
- ui.addTextArea(7, "<p align='center'><font size='13'><a href='event:close'>"..text[n].close.."</a></font>", n, 272, 330, 339, 20, 0x324650, 0x324650, 1, true)
- end
- function profile(n,info)
- ui.addTextArea(2, "", n, 262, 72, 268, 290, 0x331f15, 0x331f15, 1, true)
- ui.addTextArea(3, "", n, 262, 120, 4, 180, 0x6b4231, 0x6b4231, 1, true)
- ui.addTextArea(5, "", n, 295, 72, 198, 4, 0x6b4231, 0x6b4231, 1, true)
- ui.addTextArea(4, "", n, 526, 120, 4, 180, 0x6b4231, 0x6b4231, 1, true)
- ui.addTextArea(6, "", n, 295, 358, 198, 4, 0x6b4231, 0x6b4231, 1, true)
- ui.addTextArea(1, "<p align='center'><font face='calibri'><font size='17'><b>"..n.."</b></font></font></p><font size='14'>\n<font face='calibri'>\n"..info, n, 270, 82, 252, 270, 0x1b262b, 0x131c21, 1, true)
- ui.addTextArea(7, "<p align='center'><font size='13'><a href='event:close'>"..text[n].close.."</a></font>", n, 272, 330, 248, 20, 0x324650, 0x324650, 1, true)
- end
- function close(n)
- for i=1,7 do
- ui.removeTextArea(i,n)
- end
- end
- function nearBomber(n,x,y,p)
- if ((tfm.get.room.playerList[n].x<tfm.get.room.playerList[p].x+50 and tfm.get.room.playerList[n].x<tfm.get.room.playerList[p].x) and tfm.get.room.playerList[n].y<tfm.get.room.playerList[p].y+30 and tfm.get.room.playerList[n].y>tfm.get.room.playerList[p].y-30) and not (n==p) and data[p].health>0 and tfm.get.room.playerList[n].isFacingRight==true then
- data[p].health=data[p].health-4
- tfm.exec.displayParticle(1,x,y,0.2,0,0.2,0,nil)
- tfm.exec.displayParticle(1,x,y,0.4,0,0.4,0,nil)
- tfm.exec.displayParticle(1,x,y,0.6,0,0.6,0,nil)
- tfm.exec.displayParticle(1,x,y,0.8,0,0.8,0,nil)
- tfm.exec.displayParticle(1,x,y,1,0,1,0,nil)
- tfm.exec.displayParticle(1,x,y-10,0.2,0,0.2,0,nil)
- tfm.exec.displayParticle(1,x,y-10,0.4,0,0.4,0,nil)
- tfm.exec.displayParticle(1,x,y-10,0.6,0,0.6,0,nil)
- tfm.exec.displayParticle(1,x,y-10,0.8,0,0.8,0,nil)
- tfm.exec.displayParticle(1,x,y-10,1,0,1,0,nil)
- tfm.exec.displayParticle(1,x,y+10,0.2,0,0.2,0,nil)
- tfm.exec.displayParticle(1,x,y+10,0.4,0,0.4,0,nli)
- tfm.exec.displayParticle(1,x,y+10,0.6,0,0.6,0,nil)
- tfm.exec.displayParticle(1,x,y+10,0.8,0,0.8,0,nil)
- tfm.exec.displayParticle(1,x,y+10,1,0,1,0,nil)
- end
- if ((tfm.get.room.playerList[n].x>tfm.get.room.playerList[p].x-50 and tfm.get.room.playerList[n].x>tfm.get.room.playerList[p].x) and tfm.get.room.playerList[n].y<tfm.get.room.playerList[p].y+30 and tfm.get.room.playerList[n].y>tfm.get.room.playerList[p].y-30) and not (n==p) and data[p].health>0 and tfm.get.room.playerList[n].isFacingRight==false then
- data[p].health=data[p].health-4
- tfm.exec.displayParticle(1,x,y,-0.2,0,-0.2,0,nil)
- tfm.exec.displayParticle(1,x,y,-0.4,0,-0.4,0,nil)
- tfm.exec.displayParticle(1,x,y,-0.6,0,-0.6,0,nil)
- tfm.exec.displayParticle(1,x,y,-0.8,0,-0.8,0,nil)
- tfm.exec.displayParticle(1,x,y,-1,0,-1,0,nil)
- tfm.exec.displayParticle(1,x,y-10,-0.2,0,-0.2,0,nil)
- tfm.exec.displayParticle(1,x,y-10,-0.4,0,-0.4,0,nil)
- tfm.exec.displayParticle(1,x,y-10,-0.6,0,-0.6,0,nil)
- tfm.exec.displayParticle(1,x,y-10,-0.8,0,-0.8,0,nil)
- tfm.exec.displayParticle(1,x,y-10,-1,0,-1,0,nil)
- tfm.exec.displayParticle(1,x,y+10,-0.2,0,-0.2,0,nil)
- tfm.exec.displayParticle(1,x,y+10,-0.4,0,-0.4,0,nli)
- tfm.exec.displayParticle(1,x,y+10,-0.6,0,-0.6,0,nil)
- tfm.exec.displayParticle(1,x,y+10,-0.8,0,-0.8,0,nil)
- tfm.exec.displayParticle(1,x,y+10,-1,0,-1,0,nil)
- end
- if data[p].health<1 then
- tfm.exec.killPlayer(p)
- end
- end
- function nearProtector(n,p,x,y)
- if (tfm.get.room.playerList[n].x<tfm.get.room.playerList[p].x+50 and tfm.get.room.playerList[n].x>tfm.get.room.playerList[p].x-50 and tfm.get.room.playerList[n].y<tfm.get.room.playerList[p].y+30 and tfm.get.room.playerList[n].y>tfm.get.room.playerList[p].y-30) and not (n==p) and data[p].health>0 and data[n].health>0 then
- data[n].health=data[n].health-4
- tfm.exec.explosion(x,y,20,50,false)
- tfm.exec.displayParticle(13,x,y,-0.2,0.1,-0.2,0.1,nil)
- tfm.exec.displayParticle(13,x,y,-0.4,0,-0.4,0,nil)
- tfm.exec.displayParticle(13,x,y,-0.6,0,-0.6,0,nil)
- tfm.exec.displayParticle(3,x,y,-0.8,0,-0.8,0,nil)
- tfm.exec.displayParticle(3,x,y,-8,0,-1,0,nil)
- tfm.exec.displayParticle(3,x,y-10,-0.2,0.1,-0.2,0.1,nil)
- tfm.exec.displayParticle(13,x,y-10,-0.4,0,-0.4,0,nil)
- tfm.exec.displayParticle(13,x,y-10,-0.6,0,-0.6,0,nil)
- tfm.exec.displayParticle(13,x,y-10,-0.8,0,-0.8,0,nil)
- tfm.exec.displayParticle(13,x,y-10,-1,0,-1,0,nil)
- tfm.exec.displayParticle(13,x,y+10,-0.2,0.1,-0.2,0.1,nil)
- tfm.exec.displayParticle(13,x,y+10,-0.4,0,-0.4,0,nli)
- tfm.exec.displayParticle(13,x,y+10,-0.6,0,-0.6,0,nil)
- tfm.exec.displayParticle(13,x,y+10,-0.8,-0.1,-0.8,-0.1,nil)
- tfm.exec.displayParticle(13,x,y+10,-1,0,-1,0,nil)
- tfm.exec.displayParticle(13,x,y,0.2,0,0.2,0,nil)
- tfm.exec.displayParticle(13,x,y,0.4,0,0.4,0,nil)
- tfm.exec.displayParticle(13,x,y,0.6,0,0.6,0,nil)
- tfm.exec.displayParticle(13,x,y,0.8,0,0.8,0,nil)
- tfm.exec.displayParticle(13,x,y,1,0,1,0,nil)
- tfm.exec.displayParticle(13,x,y-10,0.2,0.1,0.2,0.1,nil)
- tfm.exec.displayParticle(13,x,y-10,0.4,0,0.4,0,nil)
- tfm.exec.displayParticle(13,x,y-10,0.6,0,0.6,0,nil)
- tfm.exec.displayParticle(13,x,y-10,0.8,0,0.8,0,nil)
- tfm.exec.displayParticle(13,x,y-10,1,0,1,0,nil)
- tfm.exec.displayParticle(13,x,y+10,0.2,0,0.2,0,nil)
- tfm.exec.displayParticle(13,x,y+10,0.4,0,0.4,0,nli)
- tfm.exec.displayParticle(13,x,y+10,0.6,0,0.6,0,nil)
- tfm.exec.displayParticle(3,x,y+10,0.8,0,0.8,0,nil)
- tfm.exec.displayParticle(3,x,y+10,8,0,1,0,nil)
- end
- if data[n].health<1 then
- tfm.exec.killPlayer(n)
- end
- end
- for n,player in pairs(tfm.get.room.playerList) do
- bindKeyboard(n)
- setLang(n)
- insertName(n)
- setData(n)
- showMenu(n)
- end
- chooseRole()
- for n,player in pairs(tfm.get.room.playerList) do
- identifyBomber(n)
- end
- function allInfo(n)
- bindKeyboard(n)
- setLang(n)
- insertName(n)
- setData(n)
- showMenu(n)
- identifyBomber(n)
- end
- function eventNewGame()
- chooseRole()
- for n,player in pairs(tfm.get.room.playerList) do
- identifyBomber(n)
- data[n].health=100
- end
- end
- function eventTextAreaCallback(txt, n, a)
- if a=="Menu" then
- showMenu(n)
- elseif a=="menu2" then
- showMenu2(n)
- elseif a=="Help" then
- displayTab(n,text[n].help,text[n].help2)
- elseif a=="close" then
- close(n)
- elseif a=="Profile" then
- profile(n,text[n].points..": <J>"..data[n].points)
- end
- end
- function eventNewPlayer(n)
- allInfo(n)
- end
- function eventLoop(time,timeRemaining)
- for n,player in pairs(tfm.get.room.playerList) do
- showHealth(n)
- end
- if timeRemaining<=0 then
- tfm.exec.newGame(maps[math.random(#maps)])
- end
- end
- function eventKeyboard(n, k, d, x, y)
- if k==32 and data[n].role==0 then
- nearBomber(n,x,y,player)
- elseif k==32 and data[n].role==1 then
- player=player
- for n in pairs(tfm.get.room.playerList) do
- nearProtector(n,player,tfm.get.room.playerList[player].x,tfm.get.room.playerList[player].y)
- end
- end
- end
- function eventPlayerDied(n)
- data[n].health=0
- if data[n].role==1 then
- tfm.exec.setGameTime(5,true)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement