×

Langue

Fermer
Atelier 801
  • Forums
  • Dev Tracker
  • Connexion
    • English Français
      Português do Brasil Español
      Türkçe Polski
      Magyar Română
      العربية Skandinavisk
      Nederlands Deutsch
      Bahasa Indonesia Русский
      中文 Filipino
      Lietuvių kalba 日本語
      Suomi עברית
      Italiano Česky
      Hrvatski Slovensky
      Български Latviešu
      Estonian
  • Langue
  • Forums
  • /
  • Transformice
  • /
  • Archives
  • /
  • Seção Editor de Mapas e Modules
  • /
  • [Lua] Peça scripts aqui!
« ‹ 114 / 133 › »
[Lua] Peça scripts aqui!
Victorck6
« Citoyen »
1578612960000
    • Victorck6#6662
    • Profil
    • Derniers messages
    • Tribu
#2261
  0
Bolodefchoco a dit :
Victorck6 a dit :
Fly a dit :
Isabel79135 a dit :
sera que poderia fazer um script tipo o breno perguntas? vou explicar

é meio o siguinte uma pessoa aleatoria sera escolhida e entao podera fazer a pergunta e junto com a pergunta colocar a resposta correspondente.
a primeira pessoa que acertar/digitar mais rapido a resposta avançara 1 casa (obs : sao 5 casa) quem chegar na ultima casa tem o direito de fazer a pergunta que quiser o "admin" podera dar skip se ver se a pessoa estiver off (ira ter um timer se a pessoa n conseguir fazer a pergunta a tempo é passado pra outra pessoa aleatoria)

bem se puderem fazer

./sala #bolodefchoco0perguntas

Funciona exatamente como você pediu

Como faço pra ter no cafofo ? Alguém diz ai

Oi, você não pode... A menos que seja dono da sua tribo?

Sou dono, e já tentei /module e o nome e não pegou, quero o nome certo do module no cafofo
Jp_darkuss
« Citoyen »
1578623340000
    • Jp_darkuss#4806
    • Profil
    • Derniers messages
#2262
  0
Luskmaps a dit :
É possível fazer um script de sorteio que os próprios usuários clicam para participar do sorteio que tenha um designer legal ?
E que tipo o lider que esta gerenciando o script tenha uma mensagem diferenciada dos demais jogadores no chat.

Já existe um modelo mais bonito que este, mas se preferir está aqui o meu:

Script

Code Lua

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
local adm={""}
local gaming={}
ui.addTextArea(0, "<p align='center'><font size='25' color='#FF6666'><a href='event:participate'>Participar</a></font></p>", nil, 200, 80, 400, 0, nil, nil, 0.5, true)
ui.addTextArea(2, "<p align='center'><font color='#6666FF' size='25'><b>Sorteio!</b></font></p>", nil, 100, 30, 600, 0, nil, nil, 0.5, true)
ui.addTextArea(3, "<p><a href='event:start'>Sortear!</a></p>", adm[1], 720, 30, 0, 0, nil, nil, 1, true)
eventTextAreaCallback= function(_, player, event)
if (event=="participate") then
ui.updateTextArea(0, "<p align='center'><font size='25' color='#66FF66'>Participando!</font></p>", player)
table.insert(gaming, player)
elseif (event=="start") then
if (#gaming>= 2) then
for pos, i in next, tfm.get.room.playerList do
tfm.exec.setShaman(pos, false)
end
local sort= gaming[math.random(1, #gaming)]
print("Wow! O jogador <b>"..string.format("%q", sort).."</b> acabou de ser sorteado!")
tfm.exec.setShaman(player, true)
tfm.exec.setShamanMode(player, 2)
tfm.exec.playEmote(player, 0)
ui.addTextArea(1, "<p align='center'><font size='16' color='#DDDDDD'>Wow! O jogador <b>"..string.format("%q", sort).."</b> acabou de ser sorteado!</font></p>", nil, 200, 130, 400, 0, nil, nil, 0.5, true)
else
print("Não há participantes o suficiente para prosseguir, é necessário haver pelo menos 2 participantes!")
end
end
end
eventChatCommand= function(player, c)
cmd={}
for i in string.gmatch(c, "%S+") do
table.insert(cmd, i)
end
if (c=="reset" and player== adm[1]) then
ui.updateTextArea(0, "<p align='center'><font size='25' color='#FF6666'><a href='event:participate'>Participar</a></font></p>", nil)
for pos, i in ipairs(gaming) do
table.remove(gaming, pos)
end
for pos, i in next, tfm.get.room.playerList do
tfm.exec.setShaman(pos, false)
end
ui.removeTextArea(1, nil)
elseif (cmd[1]=="map" and player) then
tfm.exec.newGame(cmd[2])
end
end
eventPlayerDied= function(player)
tfm.exec.respawnPlayer(player)
end
tfm.exec.disableAutoNewGame(true)
tfm.exec.disableAutoShaman(true)
tfm.exec.disableAllShamanSkills(true)
tfm.exec.disableAfkDeath(true)


Coloque seu nome com a # em local adm={""} entre as aspas.

Comandos:

!reset - use para resetar o jogo.
!map code - use para rodar um mapa caso preferir.
Jp_darkuss
« Citoyen »
1578624480000
    • Jp_darkuss#4806
    • Profil
    • Derniers messages
#2263
  0
Victorck6 a dit :
Jp_darkuss a dit :
Victorck6 a dit :
Jp_darkuss a dit :
Victorck6 a dit :
Script pra fazer amigo secreto

Script

Code Lua

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
local adm= "Victorck6#6662"
local gaming= {} --Jogadores que estão jogando no momento
local play= false --verifica se está ou não ocorrendo um jogo
local lobby= {""} --coloque aqui um mapa se quiser com o @
eventNewPlayer= function(player)
ui.addTextArea(0, "<p align='center'><font size='20' color='#1AA7DD'>Secret</font> <font size='20' color='#11B9A3'>Friend!</font></p>", player, 200, 30, 400, 30, 0xDFB4D5, 0xCFA4C5, 1, true)
ui.addTextArea(1, "<p align='center'><font size='18' color='#07CB2A'><b><a href='event:getInGame'>Participar</a></b></font></p>", nil, 245, 75, 310, 30, nil, nil, 0.5, true)
end
ui.addTextArea(0, "<p align='center'><font size='20' color='#1AA7DD'>Secret</font> <font size='20' color='#11B9A3'>Friend!</font></p>", nil, 200, 30, 400, 30, 0xDFB4D5, 0xCFA4C5, 1, true)
ui.addTextArea(1, "<p align='center'><font size='18' color='#07CB2A'><b><a href='event:getInGame'>Participar</a></b></font></p>", nil, 245, 75, 310, 30, nil, nil, 0.5, true)
eventTextAreaCallback= function(id, player, event)
if (event=="getInGame") then
if (play== false) then
ui.updateTextArea(1, "<p align='center'><font size='18' color='#07CB2A'><b>Você está participando!</b></font></p>", player)
else
ui.updateTextArea(1, "<p align='center'><font size='18' color='#FF6666'><b>Espere está partida acabar!</b></font></p>", player)
end
table.insert(gaming, player)
end
if (event=="close") then
ui.removeTextArea(4, player)
end
end
eventChatCommand= function(player, c)
local cmd= {}
for i in string.gmatch(c, "%S+") do
table.insert(cmd, i)
end
if (cmd[1]=="iniciar" and player== adm) then
for i in ipairs(gaming) do
ui.addPopup(2, 2, "<p align='center'><font color='#98E2EB'>Escreva o que você quer enviar (<b>uma palavra apenas</b>), depois o jogador com a #.</font></p>", gaming[i], 325, 150, 150, true)
end
play= true
end
if (cmd[1]=="reset" and player== adm) then
ui.addTextArea(0, "<p align='center'><font size='20' color='#1AA7DD'>Secret</font> <font size='20' color='#11B9A3'>Friend!</font></p>", nil, 200, 30, 400, 30, 0xDFB4D5, 0xCFA4C5, 1, true)
ui.addTextArea(1, "<p align='center'><font size='18' color='#07CB2A'><b><a href='event:getInGame'>Participar</a></b></font></p>", nil, 245, 75, 310, 30, nil, nil, 0.5, true)
play= false
for i in ipairs(gaming) do
table.remove(gaming, i)
end

end
end
eventPopupAnswer= function(id, player, res)
local send= {}
for i in string.gmatch(res, "%S+") do
table.insert(send, i)
end
local permil= false
for i in ipairs(gaming) do
if (send[2]== gaming[i]) then
permil= true
end
end
if (permil== true) then
ui.addTextArea(4, "<p align='center'><font size='20' color='#00CDCA'>Veja só, alguém te deu: <b>"..send[1].."</b>!</font>".."<br/><br/><p align='center'><font size='16' color='#CCFFCD'><a href='event:close'>Ok</a></font></p>", send[2], 250, 120, 300, 0, nil, nil, 1, true)
else
ui.addPopup(2, 2, "<p align='center'><font color='#FF6666' size='16'>Este jogador não está jogando!</font></p><br/><p align='center'><font color='#98E2EB'>Escreva o que você quer enviar (<b>uma palavra apenas</b>), depois o jogador com a #.</font></p>", player, 325, 150, 150, true)
end
end
tfm.exec.disableAutoShaman(true)
tfm.exec.disableAutoTimeLeft(true)
tfm.exec.disableAutoNewGame(true)
tfm.exec.disableAfkDeath(true)
tfm.exec.newGame(lobby[1], nil)


Coloque seu nome em local adm= "" entre as aspas.
Coloque o mapa que quiser em local lobby= {""} entre as aspas com o @.

Comandos do adm:

!iniciar (use para iniciar o game)
!reset (use para resetar o game.)

OBS: procure seguir bem as orientações das popups e textareas.

Não pegou amigo

O que não está funcionando bem? Se me disser talvez ainda possa concertar.

Coloquei na mensagem: Oi, e o nick da pessoa e pegou.

Mas depois fui fazer outro teste: Oi novato, e o nick da pessoa e não pegou

Ou seja se nessa mensagem tive *espaço* não vai funciona, tem que enviar tudo junto... resolve isso

Print: https://prnt.sc/qlihh1

Tenta novamente, já concertei o script, eu acho. Agora coloque entre colchetes o nome com a # e fora dele o texto: [name#0000] aqui vai a mensagem. Os mesmos comandos estão habilitados.

Script

Code Lua

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
local adm= "VICTORCK6#6662"
local gaming= {} --Jogadores que estão jogando no momento
local play= false --verifica se está ou não ocorrendo um jogo
local lobby= {""} --coloque aqui um mapa se quiser
eventNewPlayer= function(player)
ui.addTextArea(0, "<p align='center'><font size='20' color='#1AA7DD'>Secret</font> <font size='20' color='#11B9A3'>Friend!</font></p>", player, 200, 30, 400, 30, 0xDFB4D5, 0xCFA4C5, 1, true)
ui.addTextArea(1, "<p align='center'><font size='18' color='#07CB2A'><b><a href='event:getInGame'>Participar</a></b></font></p>", nil, 245, 75, 310, 30, nil, nil, 0.5, true)
end
ui.addTextArea(0, "<p align='center'><font size='20' color='#1AA7DD'>Secret</font> <font size='20' color='#11B9A3'>Friend!</font></p>", nil, 200, 30, 400, 30, 0xDFB4D5, 0xCFA4C5, 1, true)
ui.addTextArea(1, "<p align='center'><font size='18' color='#07CB2A'><b><a href='event:getInGame'>Participar</a></b></font></p>", nil, 245, 75, 310, 30, nil, nil, 0.5, true)
eventTextAreaCallback= function(id, player, event)
if (event=="getInGame") then
if (play== false) then
ui.updateTextArea(1, "<p align='center'><font size='18' color='#07CB2A'><b>Você está participando!</b></font></p>", player)
else
ui.updateTextArea(1, "<p align='center'><font size='18' color='#FF6666'><b>Espere está partida acabar!</b></font></p>", player)
end
table.insert(gaming, player)
end
if (event=="close") then
ui.removeTextArea(4, player)
end
end
eventChatCommand= function(player, c)
local cmd= {}
for i in string.gmatch(c, "%S+") do
table.insert(cmd, i)
end
if (cmd[1]=="iniciar" and player== adm) then
for i in ipairs(gaming) do
ui.addPopup(2, 2, "<p align='center'><font color='#98E2EB'>Coloque o nome do jogador com a # entre colchetes (<b>[name#0000]</b>) e depois o que você quer enviar!</font></p>", gaming[i], 325, 150, 150, true)
end
play= true
end
if (cmd[1]=="reset" and player== adm) then
ui.addTextArea(0, "<p align='center'><font size='20' color='#1AA7DD'>Secret</font> <font size='20' color='#11B9A3'>Friend!</font></p>", nil, 200, 30, 400, 30, 0xDFB4D5, 0xCFA4C5, 1, true)
ui.addTextArea(1, "<p align='center'><font size='18' color='#07CB2A'><b><a href='event:getInGame'>Participar</a></b></font></p>", nil, 245, 75, 310, 30, nil, nil, 0.5, true)
play= false
for i in ipairs(gaming) do
table.remove(gaming, i)
end

end
end
eventPopupAnswer= function(id, player, res)
local name= string.match(res, "%[(.-)%]")
local send= string.match(res, "%[.-%](.+)")
local permil= false
for i in ipairs(gaming) do
if (name== gaming[i]) then
permil= true
end
end
if (permil== true) then
ui.addTextArea(4, "<p align='center'><font size='20' color='#00CDCA'>Veja só, alguém te deu: <b>"..send.."</b>!</font>".."<br/><br/><p align='center'><font size='16' color='#CCFFCD'><a href='event:close'>Ok</a></font></p>", name, 250, 120, 300, 0, nil, nil, 1, true)
else
ui.addPopup(2, 2, "<p align='center'><font color='#FF6666' size='16'>Este jogador não está jogando!</font></p><br/><p align='center'><font color='#98E2EB'>Coloque o nome do jogador com a # entre colchetes (<b>[name#0000]</b>) e depois o que voccê quer enviar!</font></p>", player, 325, 150, 150, true)
end
end
tfm.exec.disableAutoShaman(true)
tfm.exec.disableAutoTimeLeft(true)
tfm.exec.disableAutoNewGame(true)
tfm.exec.disableAfkDeath(true)
tfm.exec.newGame(lobby[1], nil)

Dernière modification le 1578624840000
Bolodefchoco
« Sénateur »
1578625380000
    • Bolodefchoco#0095
    • Profil
    • Derniers messages
    • Tribu
#2264
  0
Victorck6 a dit :
Bolodefchoco a dit :
Victorck6 a dit :
Fly a dit :
Isabel79135 a dit :
sera que poderia fazer um script tipo o breno perguntas? vou explicar

é meio o siguinte uma pessoa aleatoria sera escolhida e entao podera fazer a pergunta e junto com a pergunta colocar a resposta correspondente.
a primeira pessoa que acertar/digitar mais rapido a resposta avançara 1 casa (obs : sao 5 casa) quem chegar na ultima casa tem o direito de fazer a pergunta que quiser o "admin" podera dar skip se ver se a pessoa estiver off (ira ter um timer se a pessoa n conseguir fazer a pergunta a tempo é passado pra outra pessoa aleatoria)

bem se puderem fazer

./sala #bolodefchoco0perguntas

Funciona exatamente como você pediu

Como faço pra ter no cafofo ? Alguém diz ai

Oi, você não pode... A menos que seja dono da sua tribo?

Sou dono, e já tentei /module e o nome e não pegou, quero o nome certo do module no cafofo

Resolvido
Victorck6
« Citoyen »
1578658440000
    • Victorck6#6662
    • Profil
    • Derniers messages
    • Tribu
#2265
  0
Jp_darkuss a dit :
Luskmaps a dit :
É possível fazer um script de sorteio que os próprios usuários clicam para participar do sorteio que tenha um designer legal ?
E que tipo o lider que esta gerenciando o script tenha uma mensagem diferenciada dos demais jogadores no chat.

Já existe um modelo mais bonito que este, mas se preferir está aqui o meu:

Script

Code Lua

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
local adm={""}
local gaming={}
ui.addTextArea(0, "<p align='center'><font size='25' color='#FF6666'><a href='event:participate'>Participar</a></font></p>", nil, 200, 80, 400, 0, nil, nil, 0.5, true)
ui.addTextArea(2, "<p align='center'><font color='#6666FF' size='25'><b>Sorteio!</b></font></p>", nil, 100, 30, 600, 0, nil, nil, 0.5, true)
ui.addTextArea(3, "<p><a href='event:start'>Sortear!</a></p>", adm[1], 720, 30, 0, 0, nil, nil, 1, true)
eventTextAreaCallback= function(_, player, event)
if (event=="participate") then
ui.updateTextArea(0, "<p align='center'><font size='25' color='#66FF66'>Participando!</font></p>", player)
table.insert(gaming, player)
elseif (event=="start") then
if (#gaming>= 2) then
for pos, i in next, tfm.get.room.playerList do
tfm.exec.setShaman(pos, false)
end
local sort= gaming[math.random(1, #gaming)]
print("Wow! O jogador <b>"..string.format("%q", sort).."</b> acabou de ser sorteado!")
tfm.exec.setShaman(player, true)
tfm.exec.setShamanMode(player, 2)
tfm.exec.playEmote(player, 0)
ui.addTextArea(1, "<p align='center'><font size='16' color='#DDDDDD'>Wow! O jogador <b>"..string.format("%q", sort).."</b> acabou de ser sorteado!</font></p>", nil, 200, 130, 400, 0, nil, nil, 0.5, true)
else
print("Não há participantes o suficiente para prosseguir, é necessário haver pelo menos 2 participantes!")
end
end
end
eventChatCommand= function(player, c)
cmd={}
for i in string.gmatch(c, "%S+") do
table.insert(cmd, i)
end
if (c=="reset" and player== adm[1]) then
ui.updateTextArea(0, "<p align='center'><font size='25' color='#FF6666'><a href='event:participate'>Participar</a></font></p>", nil)
for pos, i in ipairs(gaming) do
table.remove(gaming, pos)
end
for pos, i in next, tfm.get.room.playerList do
tfm.exec.setShaman(pos, false)
end
ui.removeTextArea(1, nil)
elseif (cmd[1]=="map" and player) then
tfm.exec.newGame(cmd[2])
end
end
eventPlayerDied= function(player)
tfm.exec.respawnPlayer(player)
end
tfm.exec.disableAutoNewGame(true)
tfm.exec.disableAutoShaman(true)
tfm.exec.disableAllShamanSkills(true)
tfm.exec.disableAfkDeath(true)


Coloque seu nome com a # em local adm={""} entre as aspas.

Comandos:

!reset - use para resetar o jogo.
!map code - use para rodar um mapa caso preferir.

Agora pegou, Obrigado!!
Victorck6
« Citoyen »
1578658920000
    • Victorck6#6662
    • Profil
    • Derniers messages
    • Tribu
#2266
  0
Annye a dit :
Jp_darkuss a dit :
Annye a dit :
Também queria um script, aonde eu pudesse fazer aparecer caixas com mensagens pop up na tela dos jogadores que estão no cafofo da tribo

Tipo, eu usaria o comando

!msg blá blá blá

E apareceria bem no meio da tela do jogador assim:

[Annye#8612] blá blá blá


(Se possível, também queria que desse para mudar a cor das letras)

Script

Code Lua

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
local adm= {"Annye#8612"}
local color="#DDDDDD"
eventChatCommand= function(player, c)
cmd= {}
for i in string.gmatch(c, "%S+") do
table.insert(cmd, i)
end
if (string.sub(c, 1, 3)=="msg" and player== adm[1]) then
ui.addTextArea(0, "<b><font color='#DDDDDD' size='14'>["..adm[1].."]</font></b> <font size='12' color='"..color.."'>"..string.sub(c, 4, #c).."<br/><br/><p align='center'><font color='#66FF66' size='16'><a href='event:a'>Ok</a></font></p>", nil, 200, 100, 400, 0, nil, nil, 0.8, true)
elseif (cmd[1]=="color" and player== adm[1]) then
color= cmd[2]
print("<font color='#DDDDDD'>A cor da fonte agora é <font color='"..color.."'>"..color.."</font>.</font>")
end
end
eventTextAreaCallback= function(id, player, event)
ui.removeTextArea(0, player)
end


Comandos:

!msg mensagem: posta a mensagem
!color #000000: muda a cor da fonte, se quiser vê-la olhe no chat #lua. O código a ser digitado em #000000 precisa ser em formato Hexadecimal.

Caso queira mudar quem comanda o script troque o nome em local adm={"Annye#8612"} mantendo as aspas.

Muito obrigada mesmo ^^

Tem como fazer algum jeito que os comandos não apareça no chat ?
Victorck6
« Citoyen »
1578659520000
    • Victorck6#6662
    • Profil
    • Derniers messages
    • Tribu
#2267
  0
Fly a dit :
Noobloops a dit :
Um script competição de firsts, com mapas que posso selecionar e com uma tabela de pontos, onde cada jogador que firstar um mapa pontua individualmente, vence quem possuir mais pontos no fim da exibição de todos os mapas, e com uma mensagem parabenizando o vencedor final.

Acredito que seja muita coisa, mas seria possível?

Script
Code Lua

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
local admin = {
['Noobloops#0000'] = true
}

local players = { }

--[[
• Insira mapas na tabela maps sem o caractere '@':
maps = { 123, 654321, 61 }
]]
local maps = { }

local game_is_started = false
local round_first_win = false

local player_list_text = "<p align='center'><font size='14'><j>Participantes</j></font>\n\n"

local current_map_index = 1

local function init()
for _, v in next, {'AutoShaman', 'AutoNewGame', 'AutoTimeLeft', 'AutoScore', 'PhysicalConsumables'} do
tfm.exec['disable' .. v]()
end

players = { }

current_map_index = 1

tfm.exec.newGame(0)
end

local function display_player_list(target)
ui.addTextArea(1, player_list_text, target, 5, 25, 200, 365, nil, 0, .8)
end

local function update_player_list(target)
local text = player_list_text

for k, v in next, players do
local score_str = ''

local tag = (target == k) and '<v>' or '<n>'

if (game_is_started) then
score_str = score_str .. string.format(': <j>%s ponto(s)', v)
end

text = text .. string.format('%s%s%s', tag, k, score_str) .. '\n'
end

ui.updateTextArea(1, text, target)
end

local function get_next_map()
_next = maps[current_map_index]
if (_next) then
return _next
end

return false
end

local function start_game()
game_is_started = true

tfm.exec.newGame(get_next_map())
end

function eventNewPlayer(player)
if (not game_is_started) then
display_player_list(target)

table.foreach(tfm.get.room.playerList, update_player_list)
end
end

function eventNewGame()
round_first_win = false

if (game_is_started) then
tfm.exec.setGameTime(62, false)

current_map_index = (current_map_index + 1)

for k in next, tfm.get.room.playerList do
if (players[k]) then
tfm.exec.setNameColor(k, 0xFFFFFF)
else
tfm.exec.killPlayer(k)
end
end

for i = -1, 1 do
ui.removeTextArea(i)
end

return
end

for k in next, tfm.get.room.playerList do
tfm.exec.setPlayerScore(k, 0)

if (admin[k]) then
ui.addTextArea(-1, "<p align='center'><a href='event:start'><j>Começar", k, 645, 25, 150, 20, 0x324650, 0, .8)
end
end

ui.addTextArea(0, "<p align='center'><a href='event:entry'><j>Participar", nil, 325, 25, 150, 20, 0x324650, 0, .8)

display_player_list()
end

function eventLoop(elapsed, remaining)
if (remaining <= 0) then
if (game_is_started) then
if (round_first_win) then
tfm.exec.newGame(get_next_map())
else
tfm.exec.newGame(tfm.get.room.currentMap)
end
end
end
end

function eventPlayerWon(player)
if (game_is_started) then
if (not round_first_win) then
round_first_win = true

tfm.exec.setGameTime(4, false)

local player_score = players[player]
if (player_score) then
players[player] = (player_score + 1)
tfm.exec.setPlayerScore(player, (player_score + 1))

if (not get_next_map()) then
game_is_started = false

for k in next, admin do
ui.addTextArea(-1, "<p align='center'><a href='event:restart'><j>Reiniciar", k, 645, 25, 150, 20, 0x324650, 0, .8)
end

local t = { };for k, v in next, players do t[#t + 1] = { k, v } end
table.sort(t, function(a, b) return a[2] > b[2] end)

return ui.addTextArea(1, string.format("<p align='center'><font size='37'>%s É O VENCEDOR. GG</font></font></p>", t[1]), nil, 5, 170, 800, nil, 0, 0, 0, true)
end
end

display_player_list()
table.foreach(tfm.get.room.playerList, update_player_list)
end
end
end

function eventPlayerDied(player)
local a = 0

for _, v in next, tfm.get.room.playerList do
if (not v.isDead) then
a = (a + 1)
end
end

if (game_is_started) then
if (a == 0) then
tfm.exec.setGameTime(4, false)
end
end
end

function eventPlayerLeft(player)
players[player] = nil

table.foreach(tfm.get.room.playerList, update_player_list)
end

function eventTextAreaCallback(_, player, callback)
if (callback == 'entry') then
if (not players[player]) then
players[player] = 0

ui.removeTextArea(0, player)

table.foreach(tfm.get.room.playerList, update_player_list)
end
elseif (callback == 'start') then
if (#maps == 0) then
return ui.addPopup(0, 0, '[Erro] A tabela maps está vazia.', player)
end

start_game()
elseif (callback == 'restart') then
init()
end
end

init()

Kydex a dit :
Script eliminatória x1 racing

Script
Code Lua

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
-- Eliminatória (remake)
-- Versão original: Pidoninho#0000

local admin = { -- Admins
['Kydex#1755'] = true
}

local players = {}

local canFinish = false
local kicking = false
local startGame = false
local finishGame = false

local maxPlayers = 100
local playersInGame = 0

local mapName = '#Elimination'
local mapCode = '17'
local roundWinner = ''
local mapWinner = ''

-- [[ Disable ]] --
system.disableChatCommandDisplay(nil)

for _, v in next, {'AutoTimeLeft', 'AutoShaman', 'AutoNewGame', 'AutoScore', 'AfkDeath', 'PhysicalConsumables'} do
tfm.exec['disable' .. v]()
end

-- [[ Functions Lib ]] --
local split = function(str, s)
local res = {}
for part in string.gmatch(str, "[^" .. s .. "]+") do
table.insert(res, part)
end
return res
end

local showPlayers = function(name)
if (playersInGame > 0) then
local a = 1

local x, y = 20, 60

local id = 1
for k in next, players do
local nick, tag = k:match('(.-)#[0-9]+$'), "<g><font size='9'>" .. k:match('#[0-9]+$')

local text = nick .. tag
if (startGame) then
text = "<a href='event:" .. k .. "'>" .. nick .. tag

ui.addTextArea(0, "<p align='center'><font size='16'><b>Escolha quem eliminar <font size='9'>(ou seja eliminado):", name, 5, 25, 790, 25, 0x324650, 0, .8)
end

local f = function()
ui.addTextArea(id, "<p align='center'>" .. text, name, x, y, 100, 20, 0x324650, 0, .8)

if (a < 7) then
a = (a + 1)

x = (x + 110)
else
a = 1

x, y = 20, (y + 30)
end

id = (id + 1)
end

if (kicking and name ~= k) then
f()
elseif (not kicking) then
f()
end
end
end
end

local start = function()
playersInGame = 0

tfm.exec.newGame('<C><P /><Z><S><S L="800" H="40" X="400" Y="380" T="14" P="0,0,0.3,0.2,0,0,0,0" /><S L="800" X="780" H="40" Y="400" T="14" P="0,0,,,90,0,0,0" /><S L="800" H="40" X="20" Y="400" T="14" P="0,0,,,90,0,0,0" /><S P="0,0,0.3,0.2,0,0,0,0" L="800" o="6a7495" X="400" c="4" N="" Y="200" T="12" H="400" /></S><D /><O /></Z></C>')

for k in next, admin do
ui.addTextArea(-1, "<p align='center'><a href='event:start'><j>Começar", k, 5, 25, 150, 20, 0x324650, 0, .8)
end

ui.addTextArea(0, "<p align='center'><a href='event:entry'><j>Participar", nil, 325, 25, 150, 20, 0x324650, 0, .8)

for k in next, tfm.get.room.playerList do
tfm.exec.setPlayerScore(k, 0)
end

showPlayers()
end

-- [[ API ]] --
function eventNewPlayer(name)
if (not startGame) then
local text = "<p align='center'><j>Você está participando."
if (not players[name]) then
text = "<p align='center'><a href='event:entry'><j>Participar"
end

ui.addTextArea(0, text, name, 325, 25, 150, 20, 0x324650, 0, .8)

showPlayers(name)
end

tfm.exec.bindKeyboard(name, 87, true)

tfm.exec.setPlayerScore(name, 0)
end
table.foreach(tfm.get.room.playerList, eventNewPlayer)

function eventNewGame()
canFinish = false
kicking = false

mapWinner = ''

if (startGame) then
ui.removeTextArea(0)

tfm.exec.addPhysicObject(0, 380, -325, {type = 14, width = 40, height = 10})
tfm.exec.addPhysicObject(1, 380, -365, {type = 14, width = 60, height = 10})
tfm.exec.addPhysicObject(2, 355, -340, {type = 14, width = 40, height = 10, angle = -90})
tfm.exec.addPhysicObject(3, 405, -340, {type = 14, width = 40, height = 10, angle = -90})

for k in next, tfm.get.room.playerList do
if (not players[k]) then
tfm.exec.movePlayer(k, 380, -340)
end
end

if (roundWinner ~= '') then
if (finishGame) then
if (players[roundWinner] and #players[roundWinner] > 0) then
local text = 'Eliminou: '

for i = 1, #players[roundWinner] do
local nick, tag = '<n>' .. players[roundWinner][i]:match('(.-)#[0-9]+$'), "<g><font size='9'>" .. players[roundWinner][i]:match('#[0-9]+$')
text = text .. nick .. tag .. (i < #players[roundWinner] and '<n>,</n> ' or '<n>.</n>')
print(i)
end

ui.addTextArea(0, text, nil, 5, 25, 200, 20, 0x324650)
end

tfm.exec.playEmote(roundWinner, 0)

tfm.exec.setGameTime(10)
else
tfm.exec.setGameTime(63)
end
else
tfm.exec.setGameTime(63)
end
else
players = {}

tfm.exec.setGameTime(99999)
end

mapName = (tfm.get.room.xmlMapInfo.author ~= '#Module' and tfm.get.room.xmlMapInfo.author or mapName)
mapCode = tfm.get.room.currentMap or mapCode
ui.setMapName('<j>' .. mapName .. ' <bl>- ' .. mapCode .. ' <g>| <n>Competidores : <v>' .. playersInGame .. '/' .. maxPlayers)
end

function eventLoop(elapsed, remaining)
local remaining = math.floor(remaining / 1000)

if (remaining < 0) then
if (finishGame) then
finishGame = false
startGame = false

start()

return
end

if (startGame) then
if (canFinish and roundWinner ~= '') then
finishGame = true

tfm.exec.newGame('<C><P /><Z><S><S P="0,0,0.3,0.2,0,0,0,0" L="200" o="324650" X="400" Y="283" T="12" H="40" /><S L="100" o="324650" X="400" H="40" Y="243" T="12" P="0,0,0.3,0.2,0,0,0,0" /><S P="0,0,0.3,0.2,0,0,0,0" L="40" o="324650" H="40" Y="203" T="12" X="400" /><S L="10" X="379" H="40" Y="160" T="14" P="0,0,0.3,0.2,0,0,0,0" /><S L="10" X="420" H="40" Y="160" T="14" P="0,0,0.3,0.2,0,0,0,0" /><S L="40" X="400" H="10" Y="137" T="14" P="0,0,0.3,0.2,0,0,0,0" /></S><D><DS Y="168" X="400" /></D><O /></Z></C>')
else
tfm.exec.newGame('#17')
end
else
ui.removeTextArea(0)

start()
end
end
end

function eventPlayerWon(name)
if (startGame) then
if (mapWinner == '') then
mapWinner = name

local a = 0
for k in next, players do
a = (a + 1)
end
if (a > 2) then
kicking = true

tfm.exec.setGameTime(10, false)

showPlayers(name)
else
for k in next, players do
if (k ~= name) then
players[k] = nil

break
end
end

canFinish = true

roundWinner = name

tfm.exec.setGameTime(4, false)
end

tfm.exec.setPlayerScore(name, tfm.get.room.playerList[name].score + 1)
end
end
end

function eventPlayerDied(name)
local a = 0
for k, v in next, tfm.get.room.playerList do
if (not v.isDead) then
a = (a + 1)
end
end
if (a == 0) then
if (startGame) then
tfm.exec.newGame('#17')
end
end
end

function eventPlayerLeft(name)
players[name] = nil

playersInGame = (playersInGame - 1)
ui.setMapName('<j>' .. mapName .. ' <bl>- ' .. mapCode .. ' <g>| <n>Competidores : <v>' .. playersInGame .. '/' .. maxPlayers)

if (not startGame) then
showPlayers()
end

if (kicking) then
showPlayers(mapWinner)
end
end

function eventChatCommand(name, cmd)
cmd = split(cmd, ' ')

-- [[ Adm Commands ]] --
if (admin[name]) then
if (cmd[1] == 'start') then
local a = 0
for k in next, players do
a = (a + 1)
end
if (a > 1) then
for i = -1, a do
ui.removeTextArea(i)
end

startGame = true

tfm.exec.newGame('#17')
end
end
end
end

function eventTextAreaCallback(id, name, cb)
if (cb == 'entry') then
if (not players[name]) then
players[name] = {}

playersInGame = (playersInGame + 1)
ui.setMapName('<j>' .. mapName .. ' <bl>- ' .. mapCode .. ' <g>| <n>Competidores : <v>' .. playersInGame .. '/' .. maxPlayers)
ui.updateTextArea(0, '<j>Você está participando.', name)

showPlayers()
end
elseif (cb == 'start') then
eventChatCommand(name, cb)
elseif (players[cb] and kicking) then
if (cb == roundWinner) then
roundWinner = ''
end

kicking = false
players[cb] = nil

playersInGame = (playersInGame - 1)

local a = 1
for k in next, players do
a = (a + 1)
end
for i = 1, a do
ui.removeTextArea(i)
end

players[name][#players[name] + 1] = cb

ui.addTextArea(0, "<p align='center'><font size='16'><b><v>" .. name .. " eliminou <r>" .. cb, nil, 5, 25, 790, 25, 0x324650, 0, .8)
ui.setMapName('<j>' .. mapName .. ' <bl>- ' .. mapCode .. ' <g>| <n>Competidores : <v>' .. playersInGame .. '/' .. maxPlayers)

tfm.exec.setGameTime(4, false)
end
end

start()

Ele não tá indo para o próximo mapa
Jp_darkuss
« Citoyen »
1578661620000
    • Jp_darkuss#4806
    • Profil
    • Derniers messages
#2268
  0
Victorck6 a dit :
Annye a dit :
Jp_darkuss a dit :
Annye a dit :
Também queria um script, aonde eu pudesse fazer aparecer caixas com mensagens pop up na tela dos jogadores que estão no cafofo da tribo

Tipo, eu usaria o comando

!msg blá blá blá

E apareceria bem no meio da tela do jogador assim:

[Annye#8612] blá blá blá


(Se possível, também queria que desse para mudar a cor das letras)

Script

Code Lua

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
local adm= {"Annye#8612"}
local color="#DDDDDD"
eventChatCommand= function(player, c)
cmd= {}
for i in string.gmatch(c, "%S+") do
table.insert(cmd, i)
end
if (string.sub(c, 1, 3)=="msg" and player== adm[1]) then
ui.addTextArea(0, "<b><font color='#DDDDDD' size='14'>["..adm[1].."]</font></b> <font size='12' color='"..color.."'>"..string.sub(c, 4, #c).."<br/><br/><p align='center'><font color='#66FF66' size='16'><a href='event:a'>Ok</a></font></p>", nil, 200, 100, 400, 0, nil, nil, 0.8, true)
elseif (cmd[1]=="color" and player== adm[1]) then
color= cmd[2]
print("<font color='#DDDDDD'>A cor da fonte agora é <font color='"..color.."'>"..color.."</font>.</font>")
end
end
eventTextAreaCallback= function(id, player, event)
ui.removeTextArea(0, player)
end


Comandos:

!msg mensagem: posta a mensagem
!color #000000: muda a cor da fonte, se quiser vê-la olhe no chat #lua. O código a ser digitado em #000000 precisa ser em formato Hexadecimal.

Caso queira mudar quem comanda o script troque o nome em local adm={"Annye#8612"} mantendo as aspas.

Muito obrigada mesmo ^^

Tem como fazer algum jeito que os comandos não apareça no chat ?

Com os comandos começando com ! aparecem, com / não aparece porque já é padrão do sistema. Mas se houver como fazer o !command desaparecer eu desconheço.
Victorck6
« Citoyen »
1578663960000
    • Victorck6#6662
    • Profil
    • Derniers messages
    • Tribu
#2269
  0
Jp_darkuss a dit :
Victorck6 a dit :
Annye a dit :
Jp_darkuss a dit :
Annye a dit :
Também queria um script, aonde eu pudesse fazer aparecer caixas com mensagens pop up na tela dos jogadores que estão no cafofo da tribo

Tipo, eu usaria o comando

!msg blá blá blá

E apareceria bem no meio da tela do jogador assim:

[Annye#8612] blá blá blá


(Se possível, também queria que desse para mudar a cor das letras)

Script

Code Lua

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
local adm= {"Annye#8612"}
local color="#DDDDDD"
eventChatCommand= function(player, c)
cmd= {}
for i in string.gmatch(c, "%S+") do
table.insert(cmd, i)
end
if (string.sub(c, 1, 3)=="msg" and player== adm[1]) then
ui.addTextArea(0, "<b><font color='#DDDDDD' size='14'>["..adm[1].."]</font></b> <font size='12' color='"..color.."'>"..string.sub(c, 4, #c).."<br/><br/><p align='center'><font color='#66FF66' size='16'><a href='event:a'>Ok</a></font></p>", nil, 200, 100, 400, 0, nil, nil, 0.8, true)
elseif (cmd[1]=="color" and player== adm[1]) then
color= cmd[2]
print("<font color='#DDDDDD'>A cor da fonte agora é <font color='"..color.."'>"..color.."</font>.</font>")
end
end
eventTextAreaCallback= function(id, player, event)
ui.removeTextArea(0, player)
end


Comandos:

!msg mensagem: posta a mensagem
!color #000000: muda a cor da fonte, se quiser vê-la olhe no chat #lua. O código a ser digitado em #000000 precisa ser em formato Hexadecimal.

Caso queira mudar quem comanda o script troque o nome em local adm={"Annye#8612"} mantendo as aspas.

Muito obrigada mesmo ^^

Tem como fazer algum jeito que os comandos não apareça no chat ?

Com os comandos começando com ! aparecem, com / não aparece porque já é padrão do sistema. Mas se houver como fazer o !command desaparecer eu desconheço.

E se fazer uma janela na tela do jogo? para enviar a mensagem para todos no cafofo
Jp_darkuss
« Citoyen »
1578672780000
    • Jp_darkuss#4806
    • Profil
    • Derniers messages
#2270
  0
Victorck6 a dit :
Jp_darkuss a dit :
Victorck6 a dit :
Annye a dit :
Jp_darkuss a dit :
Annye a dit :
Também queria um script, aonde eu pudesse fazer aparecer caixas com mensagens pop up na tela dos jogadores que estão no cafofo da tribo

Tipo, eu usaria o comando

!msg blá blá blá

E apareceria bem no meio da tela do jogador assim:

[Annye#8612] blá blá blá


(Se possível, também queria que desse para mudar a cor das letras)

Script

Code Lua

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
local adm= {"Annye#8612"}
local color="#DDDDDD"
eventChatCommand= function(player, c)
cmd= {}
for i in string.gmatch(c, "%S+") do
table.insert(cmd, i)
end
if (string.sub(c, 1, 3)=="msg" and player== adm[1]) then
ui.addTextArea(0, "<b><font color='#DDDDDD' size='14'>["..adm[1].."]</font></b> <font size='12' color='"..color.."'>"..string.sub(c, 4, #c).."<br/><br/><p align='center'><font color='#66FF66' size='16'><a href='event:a'>Ok</a></font></p>", nil, 200, 100, 400, 0, nil, nil, 0.8, true)
elseif (cmd[1]=="color" and player== adm[1]) then
color= cmd[2]
print("<font color='#DDDDDD'>A cor da fonte agora é <font color='"..color.."'>"..color.."</font>.</font>")
end
end
eventTextAreaCallback= function(id, player, event)
ui.removeTextArea(0, player)
end


Comandos:

!msg mensagem: posta a mensagem
!color #000000: muda a cor da fonte, se quiser vê-la olhe no chat #lua. O código a ser digitado em #000000 precisa ser em formato Hexadecimal.

Caso queira mudar quem comanda o script troque o nome em local adm={"Annye#8612"} mantendo as aspas.

Muito obrigada mesmo ^^

Tem como fazer algum jeito que os comandos não apareça no chat ?

Com os comandos começando com ! aparecem, com / não aparece porque já é padrão do sistema. Mas se houver como fazer o !command desaparecer eu desconheço.

E se fazer uma janela na tela do jogo? para enviar a mensagem para todos no cafofo

Já existe um script desse tipo no Fórum module, mas farei o meu modelo.
Bolodefchoco
« Sénateur »
1578680520000
    • Bolodefchoco#0095
    • Profil
    • Derniers messages
    • Tribu
#2271
  0
Victorck6 a dit :
Annye a dit :
Jp_darkuss a dit :
Annye a dit :
Também queria um script, aonde eu pudesse fazer aparecer caixas com mensagens pop up na tela dos jogadores que estão no cafofo da tribo

Tipo, eu usaria o comando

!msg blá blá blá

E apareceria bem no meio da tela do jogador assim:

[Annye#8612] blá blá blá


(Se possível, também queria que desse para mudar a cor das letras)

Script

Code Lua

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
local adm= {"Annye#8612"}
local color="#DDDDDD"
eventChatCommand= function(player, c)
cmd= {}
for i in string.gmatch(c, "%S+") do
table.insert(cmd, i)
end
if (string.sub(c, 1, 3)=="msg" and player== adm[1]) then
ui.addTextArea(0, "<b><font color='#DDDDDD' size='14'>["..adm[1].."]</font></b> <font size='12' color='"..color.."'>"..string.sub(c, 4, #c).."<br/><br/><p align='center'><font color='#66FF66' size='16'><a href='event:a'>Ok</a></font></p>", nil, 200, 100, 400, 0, nil, nil, 0.8, true)
elseif (cmd[1]=="color" and player== adm[1]) then
color= cmd[2]
print("<font color='#DDDDDD'>A cor da fonte agora é <font color='"..color.."'>"..color.."</font>.</font>")
end
end
eventTextAreaCallback= function(id, player, event)
ui.removeTextArea(0, player)
end


Comandos:

!msg mensagem: posta a mensagem
!color #000000: muda a cor da fonte, se quiser vê-la olhe no chat #lua. O código a ser digitado em #000000 precisa ser em formato Hexadecimal.

Caso queira mudar quem comanda o script troque o nome em local adm={"Annye#8612"} mantendo as aspas.

Muito obrigada mesmo ^^

Tem como fazer algum jeito que os comandos não apareça no chat ?

system.disableChatCommandDisplay()
Janethekiller
« Citoyen »
1578685380000
    • Janethekiller#7190
    • Profil
    • Derniers messages
    • Tribu
#2272
  0
Um script que faça criar raio no jogo, Similar ao evento de pesca de 2012.
Isabel79135
« Citoyen »
1578703920000
    • Isabel79135#8040
    • Profil
    • Derniers messages
#2273
  0
script que quando apertamos espaço atira um baiacu mais poderia ter tipo velocidade para jogar? (tipo eu poder mudar a velocidade do baiacu )
alguem poderia fazer?
Jp_darkuss
« Citoyen »
1578742440000
    • Jp_darkuss#4806
    • Profil
    • Derniers messages
#2274
  0
Isabel79135 a dit :
script que quando apertamos espaço atira um baiacu mais poderia ter tipo velocidade para jogar? (tipo eu poder mudar a velocidade do baiacu )
alguem poderia fazer?

Bolo, existe alguma função válida que pode gerar um consumível?
Rifate_obnoxio
« Citoyen »
1578847140000
    • Rifate_obnoxio#8830
    • Profil
    • Derniers messages
    • Tribu
#2275
  0
Jajhjul a dit :
O rato tocar no objeto e morrer (todos os objetos)

Faz sentido isso.
Fly
« Citoyen »
1578858060000
    • Fly#9225
    • Profil
    • Derniers messages
#2276
  0
Victorck6 a dit :
Fly a dit :
Noobloops a dit :
Um script competição de firsts, com mapas que posso selecionar e com uma tabela de pontos, onde cada jogador que firstar um mapa pontua individualmente, vence quem possuir mais pontos no fim da exibição de todos os mapas, e com uma mensagem parabenizando o vencedor final.

Acredito que seja muita coisa, mas seria possível?

Script
Code Lua

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
local admin = {
['Noobloops#0000'] = true
}

local players = { }

--[[
• Insira mapas na tabela maps sem o caractere '@':
maps = { 123, 654321, 61 }
]]
local maps = { }

local game_is_started = false
local round_first_win = false

local player_list_text = "<p align='center'><font size='14'><j>Participantes</j></font>\n\n"

local current_map_index = 1

local function init()
for _, v in next, {'AutoShaman', 'AutoNewGame', 'AutoTimeLeft', 'AutoScore', 'PhysicalConsumables'} do
tfm.exec['disable' .. v]()
end

players = { }

current_map_index = 1

tfm.exec.newGame(0)
end

local function display_player_list(target)
ui.addTextArea(1, player_list_text, target, 5, 25, 200, 365, nil, 0, .8)
end

local function update_player_list(target)
local text = player_list_text

for k, v in next, players do
local score_str = ''

local tag = (target == k) and '<v>' or '<n>'

if (game_is_started) then
score_str = score_str .. string.format(': <j>%s ponto(s)', v)
end

text = text .. string.format('%s%s%s', tag, k, score_str) .. '\n'
end

ui.updateTextArea(1, text, target)
end

local function get_next_map()
_next = maps[current_map_index]
if (_next) then
return _next
end

return false
end

local function start_game()
game_is_started = true

tfm.exec.newGame(get_next_map())
end

function eventNewPlayer(player)
if (not game_is_started) then
display_player_list(target)

table.foreach(tfm.get.room.playerList, update_player_list)
end
end

function eventNewGame()
round_first_win = false

if (game_is_started) then
tfm.exec.setGameTime(62, false)

current_map_index = (current_map_index + 1)

for k in next, tfm.get.room.playerList do
if (players[k]) then
tfm.exec.setNameColor(k, 0xFFFFFF)
else
tfm.exec.killPlayer(k)
end
end

for i = -1, 1 do
ui.removeTextArea(i)
end

return
end

for k in next, tfm.get.room.playerList do
tfm.exec.setPlayerScore(k, 0)

if (admin[k]) then
ui.addTextArea(-1, "<p align='center'><a href='event:start'><j>Começar", k, 645, 25, 150, 20, 0x324650, 0, .8)
end
end

ui.addTextArea(0, "<p align='center'><a href='event:entry'><j>Participar", nil, 325, 25, 150, 20, 0x324650, 0, .8)

display_player_list()
end

function eventLoop(elapsed, remaining)
if (remaining <= 0) then
if (game_is_started) then
if (round_first_win) then
tfm.exec.newGame(get_next_map())
else
tfm.exec.newGame(tfm.get.room.currentMap)
end
end
end
end

function eventPlayerWon(player)
if (game_is_started) then
if (not round_first_win) then
round_first_win = true

tfm.exec.setGameTime(4, false)

local player_score = players[player]
if (player_score) then
players[player] = (player_score + 1)
tfm.exec.setPlayerScore(player, (player_score + 1))

if (not get_next_map()) then
game_is_started = false

for k in next, admin do
ui.addTextArea(-1, "<p align='center'><a href='event:restart'><j>Reiniciar", k, 645, 25, 150, 20, 0x324650, 0, .8)
end

local t = { };for k, v in next, players do t[#t + 1] = { k, v } end
table.sort(t, function(a, b) return a[2] > b[2] end)

return ui.addTextArea(1, string.format("<p align='center'><font size='37'>%s É O VENCEDOR. GG</font></font></p>", t[1]), nil, 5, 170, 800, nil, 0, 0, 0, true)
end
end

display_player_list()
table.foreach(tfm.get.room.playerList, update_player_list)
end
end
end

function eventPlayerDied(player)
local a = 0

for _, v in next, tfm.get.room.playerList do
if (not v.isDead) then
a = (a + 1)
end
end

if (game_is_started) then
if (a == 0) then
tfm.exec.setGameTime(4, false)
end
end
end

function eventPlayerLeft(player)
players[player] = nil

table.foreach(tfm.get.room.playerList, update_player_list)
end

function eventTextAreaCallback(_, player, callback)
if (callback == 'entry') then
if (not players[player]) then
players[player] = 0

ui.removeTextArea(0, player)

table.foreach(tfm.get.room.playerList, update_player_list)
end
elseif (callback == 'start') then
if (#maps == 0) then
return ui.addPopup(0, 0, '[Erro] A tabela maps está vazia.', player)
end

start_game()
elseif (callback == 'restart') then
init()
end
end

init()

Kydex a dit :
Script eliminatória x1 racing

Script
Code Lua

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
-- Eliminatória (remake)
-- Versão original: Pidoninho#0000

local admin = { -- Admins
['Kydex#1755'] = true
}

local players = {}

local canFinish = false
local kicking = false
local startGame = false
local finishGame = false

local maxPlayers = 100
local playersInGame = 0

local mapName = '#Elimination'
local mapCode = '17'
local roundWinner = ''
local mapWinner = ''

-- [[ Disable ]] --
system.disableChatCommandDisplay(nil)

for _, v in next, {'AutoTimeLeft', 'AutoShaman', 'AutoNewGame', 'AutoScore', 'AfkDeath', 'PhysicalConsumables'} do
tfm.exec['disable' .. v]()
end

-- [[ Functions Lib ]] --
local split = function(str, s)
local res = {}
for part in string.gmatch(str, "[^" .. s .. "]+") do
table.insert(res, part)
end
return res
end

local showPlayers = function(name)
if (playersInGame > 0) then
local a = 1

local x, y = 20, 60

local id = 1
for k in next, players do
local nick, tag = k:match('(.-)#[0-9]+$'), "<g><font size='9'>" .. k:match('#[0-9]+$')

local text = nick .. tag
if (startGame) then
text = "<a href='event:" .. k .. "'>" .. nick .. tag

ui.addTextArea(0, "<p align='center'><font size='16'><b>Escolha quem eliminar <font size='9'>(ou seja eliminado):", name, 5, 25, 790, 25, 0x324650, 0, .8)
end

local f = function()
ui.addTextArea(id, "<p align='center'>" .. text, name, x, y, 100, 20, 0x324650, 0, .8)

if (a < 7) then
a = (a + 1)

x = (x + 110)
else
a = 1

x, y = 20, (y + 30)
end

id = (id + 1)
end

if (kicking and name ~= k) then
f()
elseif (not kicking) then
f()
end
end
end
end

local start = function()
playersInGame = 0

tfm.exec.newGame('<C><P /><Z><S><S L="800" H="40" X="400" Y="380" T="14" P="0,0,0.3,0.2,0,0,0,0" /><S L="800" X="780" H="40" Y="400" T="14" P="0,0,,,90,0,0,0" /><S L="800" H="40" X="20" Y="400" T="14" P="0,0,,,90,0,0,0" /><S P="0,0,0.3,0.2,0,0,0,0" L="800" o="6a7495" X="400" c="4" N="" Y="200" T="12" H="400" /></S><D /><O /></Z></C>')

for k in next, admin do
ui.addTextArea(-1, "<p align='center'><a href='event:start'><j>Começar", k, 5, 25, 150, 20, 0x324650, 0, .8)
end

ui.addTextArea(0, "<p align='center'><a href='event:entry'><j>Participar", nil, 325, 25, 150, 20, 0x324650, 0, .8)

for k in next, tfm.get.room.playerList do
tfm.exec.setPlayerScore(k, 0)
end

showPlayers()
end

-- [[ API ]] --
function eventNewPlayer(name)
if (not startGame) then
local text = "<p align='center'><j>Você está participando."
if (not players[name]) then
text = "<p align='center'><a href='event:entry'><j>Participar"
end

ui.addTextArea(0, text, name, 325, 25, 150, 20, 0x324650, 0, .8)

showPlayers(name)
end

tfm.exec.bindKeyboard(name, 87, true)

tfm.exec.setPlayerScore(name, 0)
end
table.foreach(tfm.get.room.playerList, eventNewPlayer)

function eventNewGame()
canFinish = false
kicking = false

mapWinner = ''

if (startGame) then
ui.removeTextArea(0)

tfm.exec.addPhysicObject(0, 380, -325, {type = 14, width = 40, height = 10})
tfm.exec.addPhysicObject(1, 380, -365, {type = 14, width = 60, height = 10})
tfm.exec.addPhysicObject(2, 355, -340, {type = 14, width = 40, height = 10, angle = -90})
tfm.exec.addPhysicObject(3, 405, -340, {type = 14, width = 40, height = 10, angle = -90})

for k in next, tfm.get.room.playerList do
if (not players[k]) then
tfm.exec.movePlayer(k, 380, -340)
end
end

if (roundWinner ~= '') then
if (finishGame) then
if (players[roundWinner] and #players[roundWinner] > 0) then
local text = 'Eliminou: '

for i = 1, #players[roundWinner] do
local nick, tag = '<n>' .. players[roundWinner][i]:match('(.-)#[0-9]+$'), "<g><font size='9'>" .. players[roundWinner][i]:match('#[0-9]+$')
text = text .. nick .. tag .. (i < #players[roundWinner] and '<n>,</n> ' or '<n>.</n>')
print(i)
end

ui.addTextArea(0, text, nil, 5, 25, 200, 20, 0x324650)
end

tfm.exec.playEmote(roundWinner, 0)

tfm.exec.setGameTime(10)
else
tfm.exec.setGameTime(63)
end
else
tfm.exec.setGameTime(63)
end
else
players = {}

tfm.exec.setGameTime(99999)
end

mapName = (tfm.get.room.xmlMapInfo.author ~= '#Module' and tfm.get.room.xmlMapInfo.author or mapName)
mapCode = tfm.get.room.currentMap or mapCode
ui.setMapName('<j>' .. mapName .. ' <bl>- ' .. mapCode .. ' <g>| <n>Competidores : <v>' .. playersInGame .. '/' .. maxPlayers)
end

function eventLoop(elapsed, remaining)
local remaining = math.floor(remaining / 1000)

if (remaining < 0) then
if (finishGame) then
finishGame = false
startGame = false

start()

return
end

if (startGame) then
if (canFinish and roundWinner ~= '') then
finishGame = true

tfm.exec.newGame('<C><P /><Z><S><S P="0,0,0.3,0.2,0,0,0,0" L="200" o="324650" X="400" Y="283" T="12" H="40" /><S L="100" o="324650" X="400" H="40" Y="243" T="12" P="0,0,0.3,0.2,0,0,0,0" /><S P="0,0,0.3,0.2,0,0,0,0" L="40" o="324650" H="40" Y="203" T="12" X="400" /><S L="10" X="379" H="40" Y="160" T="14" P="0,0,0.3,0.2,0,0,0,0" /><S L="10" X="420" H="40" Y="160" T="14" P="0,0,0.3,0.2,0,0,0,0" /><S L="40" X="400" H="10" Y="137" T="14" P="0,0,0.3,0.2,0,0,0,0" /></S><D><DS Y="168" X="400" /></D><O /></Z></C>')
else
tfm.exec.newGame('#17')
end
else
ui.removeTextArea(0)

start()
end
end
end

function eventPlayerWon(name)
if (startGame) then
if (mapWinner == '') then
mapWinner = name

local a = 0
for k in next, players do
a = (a + 1)
end
if (a > 2) then
kicking = true

tfm.exec.setGameTime(10, false)

showPlayers(name)
else
for k in next, players do
if (k ~= name) then
players[k] = nil

break
end
end

canFinish = true

roundWinner = name

tfm.exec.setGameTime(4, false)
end

tfm.exec.setPlayerScore(name, tfm.get.room.playerList[name].score + 1)
end
end
end

function eventPlayerDied(name)
local a = 0
for k, v in next, tfm.get.room.playerList do
if (not v.isDead) then
a = (a + 1)
end
end
if (a == 0) then
if (startGame) then
tfm.exec.newGame('#17')
end
end
end

function eventPlayerLeft(name)
players[name] = nil

playersInGame = (playersInGame - 1)
ui.setMapName('<j>' .. mapName .. ' <bl>- ' .. mapCode .. ' <g>| <n>Competidores : <v>' .. playersInGame .. '/' .. maxPlayers)

if (not startGame) then
showPlayers()
end

if (kicking) then
showPlayers(mapWinner)
end
end

function eventChatCommand(name, cmd)
cmd = split(cmd, ' ')

-- [[ Adm Commands ]] --
if (admin[name]) then
if (cmd[1] == 'start') then
local a = 0
for k in next, players do
a = (a + 1)
end
if (a > 1) then
for i = -1, a do
ui.removeTextArea(i)
end

startGame = true

tfm.exec.newGame('#17')
end
end
end
end

function eventTextAreaCallback(id, name, cb)
if (cb == 'entry') then
if (not players[name]) then
players[name] = {}

playersInGame = (playersInGame + 1)
ui.setMapName('<j>' .. mapName .. ' <bl>- ' .. mapCode .. ' <g>| <n>Competidores : <v>' .. playersInGame .. '/' .. maxPlayers)
ui.updateTextArea(0, '<j>Você está participando.', name)

showPlayers()
end
elseif (cb == 'start') then
eventChatCommand(name, cb)
elseif (players[cb] and kicking) then
if (cb == roundWinner) then
roundWinner = ''
end

kicking = false
players[cb] = nil

playersInGame = (playersInGame - 1)

local a = 1
for k in next, players do
a = (a + 1)
end
for i = 1, a do
ui.removeTextArea(i)
end

players[name][#players[name] + 1] = cb

ui.addTextArea(0, "<p align='center'><font size='16'><b><v>" .. name .. " eliminou <r>" .. cb, nil, 5, 25, 790, 25, 0x324650, 0, .8)
ui.setMapName('<j>' .. mapName .. ' <bl>- ' .. mapCode .. ' <g>| <n>Competidores : <v>' .. playersInGame .. '/' .. maxPlayers)

tfm.exec.setGameTime(4, false)
end
end

start()

Depois que não tem mais mapas o script não diz quem fez mais pontos

Script (corrigido)
Code Lua

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
local admin = { }
do
local _, _admin = pcall(nil)
_admin = string.match(_admin, "(.-)%.")
admin[_admin] = true
end

local players = { }

--[[
• Insira mapas na tabela maps sem o caractere '@':
maps = { 123, 654321, 61 }
]]
local maps = { }

local game_is_started = false
local round_first_win = false

local player_list_text = "<p align='center'><font size='14'><j>Participantes</j></font>\n\n"

local current_map_index = 1

local function init()
for _, v in next, {'AutoShaman', 'AutoNewGame', 'AutoTimeLeft', 'AutoScore', 'PhysicalConsumables'} do
tfm.exec['disable' .. v]()
end

players = { }

current_map_index = 1

tfm.exec.newGame(0)
end

local function display_player_list(target)
ui.addTextArea(1, player_list_text, target, 5, 25, 200, 365, nil, 0, .8)
end

local function update_player_list(target)
local text = player_list_text

for k, v in next, players do
local score_str = ''

local tag = (target == k) and '<v>' or '<n>'

if (game_is_started) then
score_str = score_str .. string.format(': <j>%s ponto(s)', v)
end

text = text .. string.format('%s%s%s', tag, k, score_str) .. '\n'
end

ui.updateTextArea(1, text, target)
end

local function get_next_map()
_next = maps[current_map_index]
if (_next) then
return _next
end

return false
end

local function start_game()
game_is_started = true

tfm.exec.newGame(get_next_map())
end

function eventNewPlayer(player)
if (not game_is_started) then
display_player_list(target)

table.foreach(tfm.get.room.playerList, update_player_list)
end
end

function eventNewGame()
round_first_win = false

if (game_is_started) then
tfm.exec.setGameTime(62, false)

current_map_index = (current_map_index + 1)

for k in next, tfm.get.room.playerList do
if (players[k]) then
tfm.exec.setNameColor(k, 0xFFFFFF)
else
tfm.exec.killPlayer(k)
end
end

for i = -1, 1 do
ui.removeTextArea(i)
end

return
end

for k in next, tfm.get.room.playerList do
tfm.exec.setPlayerScore(k, 0)

if (admin[k]) then
ui.addTextArea(-1, "<p align='center'><a href='event:start'><j>Começar", k, 645, 25, 150, 20, 0x324650, 0, .8)
end
end

ui.addTextArea(0, "<p align='center'><a href='event:entry'><j>Participar", nil, 325, 25, 150, 20, 0x324650, 0, .8)

display_player_list()
end

function eventLoop(elapsed, remaining)
if (remaining <= 0) then
if (game_is_started) then
if (round_first_win) then
tfm.exec.newGame(get_next_map())
else
tfm.exec.newGame(tfm.get.room.currentMap)
end
end
end
end

function eventPlayerWon(player)
if (game_is_started) then
if (not round_first_win) then
round_first_win = true

tfm.exec.setGameTime(4, false)

local player_score = players[player]
if (player_score) then
players[player] = (player_score + 1)
tfm.exec.setPlayerScore(player, (player_score + 1))

if (not get_next_map()) then
game_is_started = false

for k in next, admin do
ui.addTextArea(-1, "<p align='center'><a href='event:restart'><j>Reiniciar", k, 645, 25, 150, 20, 0x324650, 0, .8)
end

local t = { };for k, v in next, players do t[#t + 1] = { k, v } end
table.sort(t, function(a, b) return a[2] > b[2] end)

return ui.addTextArea(1, string.format("<p align='center'><font size='37'>%s É O VENCEDOR. GG</font></font></p>", t[1][1]), nil, 5, 170, 800, nil, 0, 0, 0, true)
end
end

display_player_list()
table.foreach(tfm.get.room.playerList, update_player_list)
end
end
end

function eventPlayerDied(player)
local a = 0

for _, v in next, tfm.get.room.playerList do
if (not v.isDead) then
a = (a + 1)
end
end

if (game_is_started) then
if (a == 0) then
tfm.exec.setGameTime(4, false)
end
end
end

function eventPlayerLeft(player)
players[player] = nil

table.foreach(tfm.get.room.playerList, update_player_list)
end

function eventTextAreaCallback(_, player, callback)
if (callback == 'entry') then
if (not players[player]) then
players[player] = 0

ui.removeTextArea(0, player)

table.foreach(tfm.get.room.playerList, update_player_list)
end
elseif (callback == 'start') then
if (#maps == 0) then
return ui.addPopup(0, 0, '[Erro] A tabela maps está vazia.', player)
end

start_game()
elseif (callback == 'restart') then
init()
end
end

init()

Isabel79135 a dit :
script que quando apertamos espaço atira um baiacu mais poderia ter tipo velocidade para jogar? (tipo eu poder mudar a velocidade do baiacu )

Code Lua

1
2
3
4
5
6
7
8
9
10
11
12
13
14
function eventNewPlayer(player)
system.bindKeyboard(player, 32, true)
end
table.foreach(tfm.get.room.playerList, eventNewPlayer)

function eventKeyboard(player, key, _, x, y)
local is_facing_right = tfm.get.room.playerList[player].isFacingRight

local velocity = 10 -- Velocidade X do objeto
velocity = is_facing_right and velocity or -velocity

x = is_facing_right and (x + 30) or (x - 30)
tfm.exec.addShamanObject(65, x, y, 0, velocity)
end

Jp_darkuss a dit :
Isabel79135 a dit :
script que quando apertamos espaço atira um baiacu mais poderia ter tipo velocidade para jogar? (tipo eu poder mudar a velocidade do baiacu )
alguem poderia fazer?

Bolo, existe alguma função válida que pode gerar um consumível?

tfm.exec.addShamanObject
• tfm.exec.addShamanObject ( tipo, posicaoX, posicaoY, angulo, velocidadeX, velocidadeY, transparente )
 Spawna um objeto shaman.
 Parâmetros:
  - tipo (Int) : o tipo (id) do objeto shaman a ser spawnado
  - posicaoX (Int) : a posição horizontal de spawn
  - posicaoY (Int) : a posição vertical de spawn
  - angulo (Int) : o ângulo de rotação do objetothe rotation, em graus (valor padrão = 0)
  - velocidadeX (Int) : a velocidade horizontal do objeto (valor padrão = 0)
  - velocidadeY (Int) : a velocidade vertical do objeto (valor padrão = 0)
  - transparente (Boolean) : se o objeto a ser spawnado deve ser transparente (valor padrão = false)

 Retorna: (Int) o id do objeto shaman no mapa (não do objeto shaman)

Module FAQ + Documentação Lua (Funções)
Sasukegamer
« Citoyen »
1578903120000
    • Sasukegamer#5725
    • Profil
    • Derniers messages
#2277
  0
ANT LAG
Jp_darkuss
« Citoyen »
1579003080000
    • Jp_darkuss#4806
    • Profil
    • Derniers messages
#2278
  0
Modo minimalista... ;-;
Victorck6
« Citoyen »
1579031340000
    • Victorck6#6662
    • Profil
    • Derniers messages
    • Tribu
#2279
  0
Um script de vivo ou morto, vivo a pessoa dança e morto a pessoa deita, e claro tem que ter o tempo x pra cada acão,

Tempo pra cada ação: x
admin que vai dizer vivo/morto: x
mapa da sala: x
Fly
« Citoyen »
1579061760000
    • Fly#9225
    • Profil
    • Derniers messages
#2280
  0
Victorck6 a dit :
Um script de vivo ou morto, vivo a pessoa dança e morto a pessoa deita, e claro tem que ter o tempo x pra cada acão,

Tempo pra cada ação: x
admin que vai dizer vivo/morto: x
mapa da sala: x

Script
Code Lua

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
--[[
Lista de administradores. Para adicionar um novo administrador use o formato -> ['Nick#tag'] = true

Exemplo: admin = { ['Tigrounette#0001'] = true }
]]
local admin = { ['Victorck6#6662'] = true }

local safe_players = { }

local round_is_released, game_current_emote_id, game_countdown_time

local game_default_countdown_time = 4 -- Tempo para um jogador poder executar uma ação (segundos)
local game_map = 0 -- Mapa do jogo (sem '@')

local function init()
for _, v in next, { 'AutoShaman', 'AutoNewGame', 'AutoTimeLeft' } do
tfm.exec['disable' .. v]()
end

ui.addTextArea(0, '', nil, 375, 350, 50, 50)

tfm.exec.newGame(game_map)
end

function eventNewGame()
round_is_released = false

tfm.exec.setGameTime(9e5)
end

function eventLoop(_, remaining)
if (remaining > 0) then
if (not round_is_released) then return end

game_countdown_time = (game_countdown_time - .5)
if (game_countdown_time == 0) then
for k in next, tfm.get.room.playerList do
if (not safe_players[k]) then
tfm.exec.killPlayer(k)
end
end

round_is_released = false
end

return ui.updateTextArea(0, "<p align='center'><font size='38'>" .. math.floor(game_countdown_time))
end

tfm.exec.newGame(game_map)
end

function eventEmotePlayed(player, id)
if (not round_is_released) then return end

if (game_current_emote_id == id) then
if (game_countdown_time > 0) then
safe_players[player] = true

return
end
end

tfm.exec.killPlayer(player)
end

function eventChatMessage(player, message)
if (not admin[player] or round_is_released) then return end

local commands = { ['vivo'] = 0, ['morto'] = 6 }
local id = commands[message]
if (not id) then
return
end

game_current_emote_id, game_countdown_time = id, game_default_countdown_time

round_is_released = true

safe_players = { }
end

function eventPlayerDied(player)
local a

for k, v in next, tfm.get.room.playerList do
if (not v.isDead) then
if (a) then
return
end
a = k
end
end

tfm.exec.giveCheese(a)
tfm.exec.playerVictory(a)
tfm.exec.setGameTime(4)
end

init()
  • Forums
  • /
  • Transformice
  • /
  • Archives
  • /
  • Seção Editor de Mapas e Modules
  • /
  • [Lua] Peça scripts aqui!
« ‹ 114 / 133 › »
© Atelier801 2018

Equipe Conditions Générales d'Utilisation Politique de Confidentialité Contact

Version 1.27