Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- maps={"@5504979","@5519105","@5460000","@5511019","@5509230","@5506625","@5511057"}
- t={}
- ban={}
- text=""
- tradu={}
- local estrella = "★"
- nametext="\n<b><p align='Center'><font size='18'><bv>%s"
- trans={
- es={stats="<font size='12'>\n\n\n<b>Lenguaje:%s\nFirst:%d\nRondas jugadas:%d";
- close="Cerrar";
- help="<r>¿Como jugar?</r><b>Cheesebooom es un divertido juego en el cual el bojetivo es llevar el queso al hoyo sobreviviendo de los poderes de tus rivales.</b><br><r>¿que comandos existen, para que sirve cada un?<br></r><j>!help</j>Abre la ayuda <br><j>!shop</j> abre la tienda<br><j>!stats</j>abre tu perfil<j><br>!stats nameplayer</j>abre el perfil del raton que pongas.\n\nMinijuego creado por:<b>Alenaxoxdxd</b> <b>, qloqee</b> y <b>Tiwdamerenda</b>";
- ban="<v><b><p align='Center'><font size='20'>%s has sido baneado<b><font size='15'>\n<r><a href='event:closeban'>[Cerrar]";
- shoptext="<font size='12'>Coins:<b>%d</b>\n<a href='event:sp'>Super chispa<j>(10)</j></a>"};
- br={stats="<font size='12'>\n\n\n<b>Linguagem:%s\nFirst:%d\nRodadas jogadas:%d";
- close="Fechar";
- help="<r>Como jogar?</r><b>O objetivo de Cheeseboom é levar o queijo a toca sobrevivendo dos poderes de outros jogadores.</b><br><r>Lista de comandos:<br></r><j>!help</j>Abre a ajuda.<br><j>!shop</j>Abre a loja.<br><j>!stats</j>abre seu perfil.<j><br>!stats jogador</j>abre o perfil do jogador que você colocou.\n\nMinigame criado por:<b>Alenaxoxdxd</b>,<b>qloqee</b> e <b>Tiwdamerenda</b>";
- ban="<v><b><p align='Center'><font size='20'>%s foi banido<b><font size='15'>\n<r><a href='event:closeban'>[Fechar]";
- shoptext="<font size='12'>Coins:<b>%d</b>\n<a href='event:sp'>Super espirito<j>(10)</j></a>"}
- }
- shop_items={
- sp=10;
- }
- col=0
- timed=1
- mapcrew={"Yarley"};
- admins={"Tiwdamerenda","Alenaxoxdxd","Qloqee"}
- function main()
- tfm.exec.disableAutoShaman(true)
- tfm.exec.disableAutoNewGame(true)
- tfm.exec.disableAutoScore(true)
- end
- function process(player)
- for i=1,#admins do
- if player==admins[i] then
- return true
- end
- end
- end
- function isAdm(player)
- return process(player)==true
- end
- function tablerandom(table)
- return table[math.random(#table)]
- end
- function eventNewPlayer(p)
- tfm.exec.bindKeyboard(p,32,true,true)
- if not t[p] then
- t[p]={time=os.time(),first=0,rondas=0,coins=0,sp=0}
- tradu[p]="es"
- end
- if ban[p]==nil then
- ban[p]=false
- end
- lang=tradu[p]
- ui.addTextArea(1,"<p align='Center'>¡Bienvenido a <b>Cheeseboom.!<br>ve a la <j>ayuda</j> para mas informacion escribiendo <j>!help</j>",p,(800-260)/2,88,260,80,0x324650,0x324650,1)
- ui.addTextArea(2,"<R><p align='Center'><b><a href='event:close'>"..trans[lang].close.."</a>",p,(800-260)/2,182,260,23,0x324650,0x324650,1)
- ui.addTextArea(12,"<p align='Center'><R><b>"..t[p].coins,p,6,372,22,20,0x324650,0x324650,1)
- end
- for p in pairs(tfm.get.room.playerList) do
- eventNewPlayer(p)
- end
- function buy(player,item)
- if shop_items[item] then
- if t[player].coins>=shop_items[item] then
- t[player].coins=t[player].coins-shop_items[item]
- lang=tradu[player]
- t[player][item]=t[player][item]+1
- ui.updateTextArea(12,"<p align='Center'><r><b>"..t[player].coins,player)
- ui.updateTextArea(20,trans[lang].shoptext:format(t[player].coins),player)
- end
- end
- end
- function rank(player)
- oi={}
- text="<p align='Center'>"
- for n in pairs(tfm.get.room.playerList) do
- table.insert(oi,{t[n].first,n})
- end
- table.sort(oi,function(v1,v2) return v1[1] > v2[1] end)
- for i=1,#oi do
- if i==1 then
- text=text.."\n<b>"..i.." "..oi[i][2].." "..oi[i][1].."</b>"
- else
- text=text.."\n"..i.." "..oi[i][2].." "..oi[i][1]
- end
- end
- ui.addTextArea(0, "<font size='20'><J>"..estrella..""..player.."</font>", nil, 260, 100, 300, 200, 0x191919, 0x191919, 0.6, true)
- ui.addTextArea(2, "<font size='20'><p align='center'>Ranking</font>", nil, 260, 70, 300, 30, 0x191919, 0x191919, 1.1, true)
- ui.addTextArea(1,"<p align='center'><a href='event:close'><b>X</b></a></p>", nil, 530, 100, 30, 16, 0x191919, 0x191919, 1.1, true)
- end
- function changetrans(player,lang)
- if trans[lang] then
- tradu[player]=lang
- end
- end
- function eventKeyboard(p,k,d,x,y)
- local isDead=tfm.get.room.playerList[p].isDead
- if k==32 and t[p].time < os.time()-3000 and not isDead and t[p].sp<=0 then
- tfm.exec.addShamanObject(24,x,y)
- t[p].time=os.time()
- elseif t[p].sp>0 and not isDead and t[p].time<os.time()-2000 then
- for i=1,3 do
- tfm.exec.addShamanObject(24,x,y+i)
- end
- t[p].time=os.time()
- t[p].sp=t[p].sp-1
- end
- end
- function eventLoop()
- timed=timed-0.5
- ui.addTextArea(35,"<font size='13'><b><p align='Center'><N>Time:<v>"..math.floor(timed).."<bl>|<R><a href='event:help'>?</a><bl>|<N><a href='event:rank'>Ranking</a>",nil,(800-180)/2,20,180,20,1,1,0)
- if timed<=0 then
- tfm.exec.newGame(tablerandom(maps))
- end
- end
- function capitalize(word)
- if word:sub(1,1)=="+" then
- return "+"..string.upper(word:sub(2,2))..string.lower(word:sub(3))
- else
- return string.upper(word:sub(1,1))..string.lower(word:sub(2))
- end
- end
- function eventNewGame()
- timed=120
- tfm.exec.setUIMapName("\n")
- for a in pairs(tfm.get.room.playerList)do
- t[a].rondas=t[a].rondas+1
- end;
- col=0
- for n,p in pairs(tfm.get.room.playerList) do
- if ban[n] then
- tfm.exec.killPlayer(n)
- end
- end
- end;
- function eventTextAreaCallback(id,p,cb)
- buy(p,cb)
- if cb=="close" then
- ui.removeTextArea(1,p)
- ui.removeTextArea(2,p)
- ui.removeTextArea(-2,p)
- elseif cb=="closeh" then
- ui.removeTextArea(3,p)
- ui.removeTextArea(4,p)
- elseif cb=="closep" then
- ui.removeTextArea(-1,p)
- ui.removeTextArea(7,p)
- ui.removeTextArea(8,p)
- elseif cb=="closeshop" then
- ui.removeTextArea(20,p)
- ui.removeTextArea(21,p)
- elseif cb=="closeban" then
- ui.removeTextArea(30,p)
- elseif cb=="help" then
- help(p)
- elseif cb=="rank" then
- rank(p)
- end
- end
- function bann(p)
- for name in pairs(tfm.get.room.playerList) do
- if name==p and isAdm(name)==false then
- tfm.exec.killPlayer(name)
- for budega,te in pairs(admins) do
- lang=tradu[te]
- if tfm.get.room.playerList[te] then
- ui.addTextArea(30,(trans[lang].ban):format(p),te,154,27,500,60,1,1,1);
- end
- end
- ban[p]=true
- end
- end
- end
- function unban(p)
- for name in pairs(tfm.get.room.playerList) do
- if name==p then
- if ban[p] then
- tfm.exec.respawnPlayer(name)
- ban[p]=false
- end
- end
- end
- end
- function help(p)
- lang=tradu[p]
- ui.addTextArea(3,trans[lang].help,p,227,64,325,225,0x324650,0x324650,1)
- ui.addTextArea(4,"<b><R><p align='Center'><a href='event:closeh'>X</a>",p,202,45,25,23,0x324650,0x324650,1)
- end
- function eventPlayerLeft(p)
- eventPlayerDied(p)
- end
- function eventChatCommand(p,c)
- local arg={}
- for d in c:gmatch("%S+")do
- table.insert(arg,d:lower())
- end;
- if arg[1]=="ban" and isAdm(p) then
- arg[2]=capitalize(arg[2])
- bann(arg[2])
- elseif arg[1]=="unban" and isAdm(p) then
- arg[2]=capitalize(arg[2])
- unban(arg[2])
- elseif arg[1]=="new" and isAdm(p) then
- tfm.exec.newGame(maps[math.random(#maps)])
- elseif arg[1]=="lang" then
- changetrans(p,arg[2])
- elseif arg[1]=="shop" then
- lang=tradu[p]
- ui.addTextArea(20,(trans[lang].shoptext):format(t[p].coins),p,200,80,450,230,0x324650,0x324650,1)
- ui.addTextArea(21,"<font size='12'><b><R><p align='Center'><a href='event:closeshop'>"..trans[lang].close.."</a>",p,200,320,450,23,0x324650,0x324650,1)
- elseif arg[1]=="stats" then
- if arg[2] then
- arg[2]=capitalize(arg[2])
- if t[arg[2]]~=nil and tfm.get.room.playerList[arg[2]]~=nil then
- lang=tradu[p]
- bandeira=("<b><i>"..tradu[arg[2]]):upper()
- ui.addTextArea(-1,(trans[lang].stats):format(bandeira,t[arg[2]].first,t[arg[2]].rondas),p,260,100,300,200,0x191919,0x191919,1.1,true)
- ui.addTextArea(7,(nametext):format(arg[2]),p,260,100,300,70,0x191919,0x191919,0.0,true)
- ui.addTextArea(8,"<b><r><i><p align='Center'><a href='event:closep'>"..trans[lang].close.."</a>",p,530,100,30,16,0x191919,0x191919,1.1,true)
- end
- end
- if not arg[2] then
- lang=tradu[p]
- bandeira=("<b><i>"..lang):upper()
- ui.addTextArea(-1,trans[lang].stats:format(bandeira,t[p].first,t[p].rondas),p,260,100,300,200,0x191919,0x191919,1.1,true)
- ui.addTextArea(7,nametext:format(p),p,260,100,300,70,0x191919,0x191919,0.0,true)
- ui.addTextArea(8,"<b><r><i><p align='Center'><a href='event:closep'><B>X</B></a>",p,530,100,30,16,0x191919,0x191919,1.1,true)
- end
- end
- end
- function eventPlayerDied(p)
- local i=0
- for n,player in pairs(tfm.get.room.playerList) do
- if not player.isDead then
- i=i+1
- end
- end
- if i==0 then
- tfm.exec.newGame(tablerandom(maps))
- elseif i==1 and timed>=2 then
- timed=math.floor(timed/2)
- end
- end
- function eventPlayerWon(p)
- col=col+1
- ui.updateTextArea(12,"<p align='Center'><R><b>"..t[p].coins,p)
- eventPlayerDied(p)
- if col==1 then
- t[p].first=t[p].first+1
- t[p].coins=t[p].coins+10
- else
- t[p].coins=t[p].coins+5
- end
- ui.updateTextArea(12,"<p align='Center'><R><b>"..t[p].coins,p)
- end
- for n,comands in pairs({"Ban","Unban","Stats","Shop","Lang","New"}) do
- system.disableChatCommandDisplay(comands,true)
- system.disableChatCommandDisplay(comands:lower(),true)
- end
- main();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement