Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- for _, v in next, {"utoNewGame", "utoShaman", "utoTimeLeft", "fkDeath", "utoScore"} do
- tfm.exec['disableA'..v]()
- end
- local isTribeHouse = tfm.get.room.name:byte(2) == 3
- local fundos = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}
- local fundo = fundos[math.random(#fundos)]
- local xml = '<C><P F="'..fundo..'" /><Z><S><S L="10" X="93" H="404" Y="222" T="14" P="0,0,0,0,0,0,0,0" /><S L="801" X="400" H="165" Y="467" T="1" P="0,0,0,0.2,0,0,0,0" /><S L="10" H="404" X="220" Y="209" T="14" P="0,0,0,0,0,0,0,0" /><S L="10" X="357" H="404" Y="207" T="14" P="0,0,0,0,0,0,0,0" /><S L="10" H="404" X="502" Y="207" T="14" P="0,0,0,0,0,0,0,0" /><S L="10" X="654" H="404" Y="207" T="14" P="0,0,0,0,0,0,0,0" /></S><D><DS Y="356" X="47" /><T Y="381" X="773" /></D><O /></Z></C>'
- local contagem = 10000;
- local tempo = os.time();
- local s = 0
- local s2 = 10
- local data = {}
- local admins = {Flyingwr = true, Rianmojang1 = true}
- local alfabeto = {
- vogais = {
- "a", "e", "i", "o", "u", ""
- },
- consoantes = {
- "b", "c", "d", "f", "g", "h", "j", "k", "l", "m", "n", "p", "q", "r", "s", "t", "v", "w", "x", "y", "z"
- }
- };
- local palavra = false;
- local maxVogais = 3; -- Máximo de vogais na palavra gerada. Exemplo: "Irineu" (4 vogais)
- local maxCons = 2; -- Máximo de consoantes na palavra gerada. Exemplo "aailrqqtcytmmdcszgdklcjgkr" (22 consoantes)
- local vogal, consoante;
- function gerador()
- palavra = '';
- for i=1, maxVogais+maxCons do
- for _,v in next,alfabeto.vogais do
- if string.len(palavra) < maxVogais then
- vogal = alfabeto.vogais[math.random(#alfabeto.vogais)];
- palavra = palavra .. vogal;
- end
- end
- for _,v in next,alfabeto.consoantes do
- if (string.len(palavra) < maxCons + maxVogais) then
- consoante = alfabeto.consoantes[math.random(#alfabeto.consoantes)];
- palavra = palavra .. consoante;
- end
- end
- end
- if isTribeHouse then
- print("<v>[Script] <n>Palavra : " .. palavra)
- else
- for k, v in next, admins do
- tfm.exec.chatMessage("<v>[Script] <n>Palavra : " .. palavra, k)
- end
- end
- end
- function string.split(str,s)
- local res = {}
- for part in string.gmatch(str, "[^" .. s .. "]+") do
- table.insert(res, part)
- end
- return res
- end
- function eventNewPlayer(name)
- data[name] = {
- p = 0,
- }
- end
- table.foreach(tfm.get.room.playerList, eventNewPlayer)
- function eventChatCommand(name, cmd)
- local cmd = string.split(cmd, " ")
- if admins[name] then
- if not isTribeHouse then
- if cmd[1] == "pw" then
- if cmd[2] then
- tfm.exec.setRoomPassword(cmd[2])
- for k, v in next, admins do
- tfm.exec.chatMessage("<v>[Script] <n>Senha da sala : " .. cmd[2] .. ". Colocada por <v>" .. name .. "<n>.", k)
- end
- else
- tfm.exec.setRoomPassword("")
- for k, v in next, admins do
- tfm.exec.chatMessage("<v>[Script] <n>Senha da sala removida por <v>" .. name .. "<n>.", k)
- end
- end
- elseif cmd[1] == "lock" then
- if cmd[2] then
- tfm.exec.setRoomMaxPlayers(tonumer(cmd[2]))
- for k, v in next, admins do
- tfm.exec.chatMessage("<v>[Script] <n>Sala trancada para " .. cmd[2] .. " ratos por <v>" .. name .. "<n>.", k)
- end
- end
- end
- end
- end
- end
- function eventChatMessage(name,msg)
- if msg == palavra and (s2 <= 0) and not tfm.get.room.playerList[name].isDead then
- data[name].p=data[name].p+1
- tfm.exec.setPlayerScore(name, data[name].p)
- maxVogais = (#palavra < 30 and maxVogais + 3 or maxVogais)
- maxCons = (#palavra < 30 and maxCons + 2 or maxCons)
- if data[name].p == 1 then
- tfm.exec.movePlayer(name,112,369,false,1,1,false)
- gerador()
- tempo = os.time()
- contagem = 10000
- s = 0
- s2 = 10
- elseif data[name].p == 2 then
- tfm.exec.movePlayer(name,239,369,false,1,1,false)
- gerador()
- tempo = os.time()
- contagem = 10000
- s = 0
- s2 = 10
- elseif data[name].p == 3 then
- tfm.exec.movePlayer(name,376,369,false,1,1,false)
- gerador()
- tempo = os.time()
- contagem = 10000
- s = 0
- s2 = 10
- elseif data[name].p == 4 then
- tfm.exec.movePlayer(name,551,369,false,1,1,false)
- gerador()
- tempo = os.time()
- contagem = 10000
- s = 0
- s2 = 10
- elseif data[name].p == 5 then
- tfm.exec.movePlayer(name,663,369,false,1,1,false)
- tfm.exec.giveCheese(name)
- end
- end
- end
- function eventLoop(e,r)
- s=s+0.5
- if s == 1 then
- s2=s2-1
- s=0
- end
- if tempo < os.time() - contagem then
- ui.addTextArea(0, "<font size=\"20\">"..palavra.."", nil, 5, 23, 791, 33, 0x324650, 0x000000, 1, true)
- else
- ui.addTextArea(0, "Proxima palavra em: <CE>"..s2.."", nil)
- end
- if (r/1000) <= 0 then
- tfm.exec.newGame(xml)
- end
- end
- tfm.exec.newGame(xml)
- function eventNewGame()
- tempo = os.time()
- contagem = 10000
- s = 0
- s2 = 10
- maxVogais = 3
- maxCons = 2
- gerador()
- tfm.exec.setGameTime(60*4.5)
- ui.setMapName(string.format("<j>Rianmojang1 <bl>- @666"))
- fundo = fundos[math.random(#fundos)]
- xml = '<C><P F="'..fundo..'" /><Z><S><S L="10" X="93" H="404" Y="222" T="14" P="0,0,0,0,0,0,0,0" /><S L="801" X="400" H="165" Y="467" T="1" P="0,0,0,0.2,0,0,0,0" /><S L="10" H="404" X="220" Y="209" T="14" P="0,0,0,0,0,0,0,0" /><S L="10" X="357" H="404" Y="207" T="14" P="0,0,0,0,0,0,0,0" /><S L="10" H="404" X="502" Y="207" T="14" P="0,0,0,0,0,0,0,0" /><S L="10" X="654" H="404" Y="207" T="14" P="0,0,0,0,0,0,0,0" /></S><D><DS Y="356" X="47" /><T Y="381" X="773" /></D><O /></Z></C>'
- for k, v in next, data do
- v.p = 0
- tfm.exec.setPlayerScore(k, 0)
- end
- end
- function eventPlayerWon(name)
- tfm.exec.setGameTime(5)
- end
- function eventPlayerDied(name)
- local a = {}
- for k, v in next, tfm.get.room.playerList do
- if not v.isDead then
- a[#a + 1] = k
- end
- end
- if #a == 0 then
- tfm.exec.setGameTime(5)
- end
- end
- for k, v in next, {"pw", "lock"} do
- system.disableChatCommandDisplay(v)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement