×

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!
« ‹ 34 / 133 › »
[Lua] Peça scripts aqui!
Bolodefchoco
« Sénateur »
1518224400000
    • Bolodefchoco#0095
    • Profil
    • Derniers messages
    • Tribu
#661
  0
Lxlevel a dit :
Bolodefchoco a dit :
Lxlevel a dit :
Bolodefchoco a dit :
Lxlevel a dit :
modo de survivor que você fez para mim tem como mudar para modo survivor, nos botes 1 - cn pra baixo 2 - cn para direita 3 - cn para esquerda 4 - sp 5- caixa, o resto vc define como está

Não é possível alterar isso, also

Você pode jogar #cannonup, é um survivor automático que não tem shaman

Moço tava jogando com amigos e quando eles ganham eles não estão ganhando os pontos, de sobrevivencia ou seja eles não conseguem ser sha só eu

Adicione isso no fim do código:

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
local newMap, winners = true, false
eventNewGame = function()
newMap = false
winners = false
end

players = function()
local shaman, alive, total = 0, 0, 0
for k, v in next, tfm.get.room.playerList do
if not v.isDead then
if v.isShaman then
shaman = shaman + 1
else
alive = alive + 1
end
end
total = total + 1
end
return shaman, alive, total
end

eventLoop = function(current, elapsed)
if newMap then
tfm.exec.newGame("#10")
else
local shaman, alive, total = players()
if total > 1 then
local time = false
if shaman < 1 then
time = true
if not winners then
winners = true
for k, v in next, tfm.get.room.playerList do
if not v.isDead then
tfm.exec.setPlayerScore(k, 5, true)
end
end
end
end
time = time or alive < 2

if time then
tfm.exec.setGameTime(10, false)
end
end

if elapsed < 2000 then
newMap = true
end
end
end
tfm.exec.disableAutoNewGame()
tfm.exec.disableAutoScore()

Deve funcionar.. Eu não lembro como surv funciona :c

Infelizmente não foi, Explicando: Survivor é um jogo onde você sobrevive com o sha tentando-lhe matar, após ganhar você ganha o score de 10 pontos a cada rodada sobrevivida, quem tiver mais scores é o proximo sha, e assim que acaba a vez de sha dele, o score dele é zerado e a pessoa com mais pontos é o proximo shaman, assim por diante

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
local newMap, winners = true, false
eventNewGame = function()
newMap = false
winners = false
end

players = function()
local shaman, alive, total = 0, 0, 0
for k, v in next, tfm.get.room.playerList do
if not v.isDead then
if v.isShaman then
shaman = shaman + 1
else
alive = alive + 1
end
end
total = total + 1
end
return shaman, alive, total
end

eventLoop = function(current, elapsed)
if newMap then
tfm.exec.newGame("#10")
else
local shaman, alive, total = players()
if total > 1 and (shaman < 1 or alive < 2) then
tfm.exec.setGameTime(10, false)
end

if elapsed < 2000 then
newMap = true
if not winners then
winners = true
for k, v in next, tfm.get.room.playerList do
if v.isShaman then
tfm.exec.setPlayerScore(k, 0)
elseif not v.isDead then
tfm.exec.setPlayerScore(k, 10, true)
end
end
end
end
end
end

tfm.exec.disableAutoNewGame()
tfm.exec.disableAutoScore()
Neo
« Citoyen »
1518224880000
    • Neo#7537
    • Profil
    • Derniers messages
#662
  0
Bolodefchoco a dit :
Lxlevel a dit :
Bolodefchoco a dit :
Lxlevel a dit :
Bolodefchoco a dit :
Lxlevel a dit :
modo de survivor que você fez para mim tem como mudar para modo survivor, nos botes 1 - cn pra baixo 2 - cn para direita 3 - cn para esquerda 4 - sp 5- caixa, o resto vc define como está

Não é possível alterar isso, also

Você pode jogar #cannonup, é um survivor automático que não tem shaman

Moço tava jogando com amigos e quando eles ganham eles não estão ganhando os pontos, de sobrevivencia ou seja eles não conseguem ser sha só eu

Adicione isso no fim do código:

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
local newMap, winners = true, false
eventNewGame = function()
newMap = false
winners = false
end

players = function()
local shaman, alive, total = 0, 0, 0
for k, v in next, tfm.get.room.playerList do
if not v.isDead then
if v.isShaman then
shaman = shaman + 1
else
alive = alive + 1
end
end
total = total + 1
end
return shaman, alive, total
end

eventLoop = function(current, elapsed)
if newMap then
tfm.exec.newGame("#10")
else
local shaman, alive, total = players()
if total > 1 then
local time = false
if shaman < 1 then
time = true
if not winners then
winners = true
for k, v in next, tfm.get.room.playerList do
if not v.isDead then
tfm.exec.setPlayerScore(k, 5, true)
end
end
end
end
time = time or alive < 2

if time then
tfm.exec.setGameTime(10, false)
end
end

if elapsed < 2000 then
newMap = true
end
end
end
tfm.exec.disableAutoNewGame()
tfm.exec.disableAutoScore()

Deve funcionar.. Eu não lembro como surv funciona :c

Infelizmente não foi, Explicando: Survivor é um jogo onde você sobrevive com o sha tentando-lhe matar, após ganhar você ganha o score de 10 pontos a cada rodada sobrevivida, quem tiver mais scores é o proximo sha, e assim que acaba a vez de sha dele, o score dele é zerado e a pessoa com mais pontos é o proximo shaman, assim por diante

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
local newMap, winners = true, false
eventNewGame = function()
newMap = false
winners = false
end

players = function()
local shaman, alive, total = 0, 0, 0
for k, v in next, tfm.get.room.playerList do
if not v.isDead then
if v.isShaman then
shaman = shaman + 1
else
alive = alive + 1
end
end
total = total + 1
end
return shaman, alive, total
end

eventLoop = function(current, elapsed)
if newMap then
tfm.exec.newGame("#10")
else
local shaman, alive, total = players()
if total > 1 and (shaman < 1 or alive < 2) then
tfm.exec.setGameTime(10, false)
end

if elapsed < 2000 then
newMap = true
if not winners then
winners = true
for k, v in next, tfm.get.room.playerList do
if v.isShaman then
tfm.exec.setPlayerScore(k, 0)
elseif not v.isDead then
tfm.exec.setPlayerScore(k, 10, true)
end
end
end
end
end
end

tfm.exec.disableAutoNewGame()
tfm.exec.disableAutoScore()

Realmente não está indo, acho que vou ter que largar o plano de tentar fazer survivor no cafofo, deve ser muito cansativo para você também desculpa pelo encomodo, O problema de agora foi que : Quando a gente morre não ganha 1 ponto, e tambem o tempo está com 10s com 2 pessoas ou mais na sala

Dernière modification le 1518224940000
Bolodefchoco
« Sénateur »
1518225600000
    • Bolodefchoco#0095
    • Profil
    • Derniers messages
    • Tribu
#663
  0
Lxlevel a dit :
Bolodefchoco a dit :
Lxlevel a dit :
Bolodefchoco a dit :
Lxlevel a dit :
Bolodefchoco a dit :
Lxlevel a dit :
modo de survivor que você fez para mim tem como mudar para modo survivor, nos botes 1 - cn pra baixo 2 - cn para direita 3 - cn para esquerda 4 - sp 5- caixa, o resto vc define como está

Não é possível alterar isso, also

Você pode jogar #cannonup, é um survivor automático que não tem shaman

Moço tava jogando com amigos e quando eles ganham eles não estão ganhando os pontos, de sobrevivencia ou seja eles não conseguem ser sha só eu

Adicione isso no fim do código:

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
local newMap, winners = true, false
eventNewGame = function()
newMap = false
winners = false
end

players = function()
local shaman, alive, total = 0, 0, 0
for k, v in next, tfm.get.room.playerList do
if not v.isDead then
if v.isShaman then
shaman = shaman + 1
else
alive = alive + 1
end
end
total = total + 1
end
return shaman, alive, total
end

eventLoop = function(current, elapsed)
if newMap then
tfm.exec.newGame("#10")
else
local shaman, alive, total = players()
if total > 1 then
local time = false
if shaman < 1 then
time = true
if not winners then
winners = true
for k, v in next, tfm.get.room.playerList do
if not v.isDead then
tfm.exec.setPlayerScore(k, 5, true)
end
end
end
end
time = time or alive < 2

if time then
tfm.exec.setGameTime(10, false)
end
end

if elapsed < 2000 then
newMap = true
end
end
end
tfm.exec.disableAutoNewGame()
tfm.exec.disableAutoScore()

Deve funcionar.. Eu não lembro como surv funciona :c

Infelizmente não foi, Explicando: Survivor é um jogo onde você sobrevive com o sha tentando-lhe matar, após ganhar você ganha o score de 10 pontos a cada rodada sobrevivida, quem tiver mais scores é o proximo sha, e assim que acaba a vez de sha dele, o score dele é zerado e a pessoa com mais pontos é o proximo shaman, assim por diante

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
local newMap, winners = true, false
eventNewGame = function()
newMap = false
winners = false
end

players = function()
local shaman, alive, total = 0, 0, 0
for k, v in next, tfm.get.room.playerList do
if not v.isDead then
if v.isShaman then
shaman = shaman + 1
else
alive = alive + 1
end
end
total = total + 1
end
return shaman, alive, total
end

eventLoop = function(current, elapsed)
if newMap then
tfm.exec.newGame("#10")
else
local shaman, alive, total = players()
if total > 1 and (shaman < 1 or alive < 2) then
tfm.exec.setGameTime(10, false)
end

if elapsed < 2000 then
newMap = true
if not winners then
winners = true
for k, v in next, tfm.get.room.playerList do
if v.isShaman then
tfm.exec.setPlayerScore(k, 0)
elseif not v.isDead then
tfm.exec.setPlayerScore(k, 10, true)
end
end
end
end
end
end

tfm.exec.disableAutoNewGame()
tfm.exec.disableAutoScore()

Realmente não está indo, acho que vou ter que largar o plano de tentar fazer survivor no cafofo, deve ser muito cansativo para você também desculpa pelo encomodo, O problema de agora foi que : Quando a gente morre não ganha 1 ponto, e tambem o tempo está com 10s com 2 pessoas ou mais na sala

Como eu ia saber que ganha 1 ponto quando morre né hueh

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
local newMap, winners = true, false
eventNewGame = function()
newMap = false
winners = false
end

players = function()
local shaman, alive, total = 0, 0, 0
for k, v in next, tfm.get.room.playerList do
if not v.isDead then
if v.isShaman then
shaman = shaman + 1
else
alive = alive + 1
end
end
total = total + 1
end
return shaman, alive, total
end

eventLoop = function(current, elapsed)
if newMap then
tfm.exec.newGame("#10")
else
local shaman, alive, total = players()
if total > 2 and (shaman < 1 or alive < 2) then
tfm.exec.setGameTime(10, false)
end

if elapsed < 2000 then
newMap = true
if not winners then
winners = true
for k, v in next, tfm.get.room.playerList do
if v.isShaman then
tfm.exec.setPlayerScore(k, 0)
elseif not v.isDead then
tfm.exec.setPlayerScore(k, 10, true)
end
end
end
end
end
end

eventPlayerDied = function(n)
if not tfm.get.room.playerList[n].isShaman then
tfm.exec.setPlayerScore(n, 1, true)
end
end

tfm.exec.disableAutoNewGame()
tfm.exec.disableAutoScore()
tfm.exec.disableAllShamanSkills()
tfm.exec.disableAutoTimeLeft()

Dernière modification le 1518226320000
Colbya
« Citoyen »
1518229500000
    • Colbya#0000
    • Profil
    • Derniers messages
#664
  0
tem alguns tipo de script que assusta um player de qualque tipo?
Mi_uk
« Citoyen »
1518230580000
    • Mi_uk#0000
    • Profil
    • Derniers messages
#665
  0
Opa, Poderia cria um script de tabela de torneio ? Tipo assim > http://3.bp.blogspot.com/-WZXed1TXO0c/T0kK8PwuHDI/AAAAAAAAAlw/p1Lc7Nzs9UA/s1600/Tabela+Torneio+In%C3%ADcio.JPG

onde você pode botar os nomes das pessoas presentes na sala

Dernière modification le 1518230640000
Mi_uk
« Citoyen »
1518232500000
    • Mi_uk#0000
    • Profil
    • Derniers messages
#666
  0
Fofajenni a dit :
Fofinhoppp a dit :
Fofajenni a dit :
alguém tem o lua do my city?

acho que não hein kkkkk

po fofin
qro jogar na tribo
maldoso

./module #mycity (ja tentou ??)
Kabu
« Consul »
1518257280000
    • Kabu#6682
    • Profil
    • Derniers messages
    • Tribu
#667
  0
Script de apertar a barra de espaço e o rato irá correr mais rápido (speed)?
Jellymichey
« Censeur »
1518257580000
    • Jellymichey#0000
    • Profil
    • Derniers messages
    • Tribu
#668
  0
Mi_uk a dit :
Fofajenni a dit :
Fofinhoppp a dit :
Fofajenni a dit :
alguém tem o lua do my city?

acho que não hein kkkkk

po fofin
qro jogar na tribo
maldoso

./module #mycity (ja tentou ??)

o mycity n tem sala própria acho
Fofinhoppp
« Consul »
1518263460000
    • Fofinhoppp#0000
    • Profil
    • Derniers messages
    • Tribu
#669
  0
Jellymichey a dit :
Mi_uk a dit :
Fofajenni a dit :
Fofinhoppp a dit :
Fofajenni a dit :
alguém tem o lua do my city?

acho que não hein kkkkk

po fofin
qro jogar na tribo
maldoso

./module #mycity (ja tentou ??)

o mycity n tem sala própria acho

tem sim, /sala #paintball0mycity
tá desatualizado pq eu tô trabalhando na próxima atualização ainda
Jellymichey
« Censeur »
1518266040000
    • Jellymichey#0000
    • Profil
    • Derniers messages
    • Tribu
#670
  0
Fofinhoppp a dit :
Jellymichey a dit :
Mi_uk a dit :
Fofajenni a dit :
Fofinhoppp a dit :
Fofajenni a dit :
alguém tem o lua do my city?

acho que não hein kkkkk

po fofin
qro jogar na tribo
maldoso

./module #mycity (ja tentou ??)

o mycity n tem sala própria acho

tem sim, /sala #paintball0mycity
tá desatualizado pq eu tô trabalhando na próxima atualização ainda

acho que n entendeu o que eu quis dizer

sala própria mesmo #mycity
não hosteado em outro module
Bolodefchoco
« Sénateur »
1518275760000
    • Bolodefchoco#0095
    • Profil
    • Derniers messages
    • Tribu
#671
  0
Anneifofinha a dit :
tem alguns tipo de script que assusta um player de qualque tipo?

Desculpe, não sei como por uma foto minha na sala :c


Mi_uk a dit :
Opa, Poderia cria um script de tabela de torneio ? Tipo assim > http://3.bp.blogspot.com/-WZXed1TXO0c/T0kK8PwuHDI/AAAAAAAAAlw/p1Lc7Nzs9UA/s1600/Tabela+Torneio+In%C3%ADcio.JPG

onde você pode botar os nomes das pessoas presentes na sala

Desculpe, não entro em links assim. Se puder, utilize [img] e seja o mais detalhista possível


Icrower a dit :
Script de apertar a barra de espaço e o rato irá correr mais rápido (speed)?

Code Lua

1
2
3
4
5
6
7
8
9
eventNewPlayer = function(n)
system.bindKeyboard(n, 32, true, true)
end
table.foreach(tfm.get.room.playerList, eventNewPlayer)

eventKeyboard = function(n, k)
local dir = tfm.get.room.playerList[n].isFacingRight and 1 or -1
tfm.exec.movePlayer(n, 0, 0, false, 10 * dir, 0, true)
end

Fofinhoppp a dit :
Jellymichey a dit :
Mi_uk a dit :
Fofajenni a dit :
Fofinhoppp a dit :
Fofajenni a dit :
alguém tem o lua do my city?

acho que não hein kkkkk

po fofin
qro jogar na tribo
maldoso

./module #mycity (ja tentou ??)

o mycity n tem sala própria acho

tem sim, /sala #paintball0mycity
tá desatualizado pq eu tô trabalhando na próxima atualização ainda

Num é por isso não hein -q

Jellymichey a dit :
Fofinhoppp a dit :
Jellymichey a dit :
Mi_uk a dit :
Fofajenni a dit :
Fofinhoppp a dit :
Fofajenni a dit :
alguém tem o lua do my city?

acho que não hein kkkkk

po fofin
qro jogar na tribo
maldoso

./module #mycity (ja tentou ??)

o mycity n tem sala própria acho

tem sim, /sala #paintball0mycity
tá desatualizado pq eu tô trabalhando na próxima atualização ainda

acho que n entendeu o que eu quis dizer

sala própria mesmo #mycity
não hosteado em outro module

Acho que nem tem comando pra carregar o mycity no cafofo, indeed

Dernière modification le 1518275880000
Marcyellem
« Citoyen »
1518381840000
    • Marcyellem#0000
    • Profil
    • Derniers messages
    • Tribu
#672
  0
Alguém sabe qual o script do module stop/adedanha?
Bolodefchoco
« Sénateur »
1518381960000
    • Bolodefchoco#0095
    • Profil
    • Derniers messages
    • Tribu
#673
  0
Marcyellem a dit :
Alguém sabe qual o script do module stop/adedanha?

Se encontra na Galeria do Ninguem.
Ninguem a dit :

Última versão: http://pastebin.com/raw/k06Tvfku
Versão onde só votos de ADMIN contam: https://pastebin.com/raw/uvx8ZDzz
Marcyellem
« Citoyen »
1518382080000
    • Marcyellem#0000
    • Profil
    • Derniers messages
    • Tribu
#674
  0
Bolodefchoco a dit :
Marcyellem a dit :
Alguém sabe qual o script do module stop/adedanha?

Se encontra na Galeria do Ninguem.
Ninguem a dit :

Última versão: http://pastebin.com/raw/k06Tvfku
Versão onde só votos de ADMIN contam: https://pastebin.com/raw/uvx8ZDzz


Obg
Mas o site não abre asuayhsuia scr
Não conhece alguém que o tenha sem ser nesse site?
Bolodefchoco
« Sénateur »
1518383580000
    • Bolodefchoco#0095
    • Profil
    • Derniers messages
    • Tribu
#675
  0
Marcyellem a dit :
Bolodefchoco a dit :
Marcyellem a dit :
Alguém sabe qual o script do module stop/adedanha?

Se encontra na Galeria do Ninguem.
Ninguem a dit :

Última versão: http://pastebin.com/raw/k06Tvfku
Versão onde só votos de ADMIN contam: https://pastebin.com/raw/uvx8ZDzz


Obg
Mas o site não abre asuayhsuia scr
Não conhece alguém que o tenha sem ser nesse site?

última versão

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
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
-- STOP
-- Escrito por Ninguem - 31/08/2015

ADM = {"Ninguem"}
CAT = {"Nome","Vegetal","Animal","Marca","Profissão","Objeto","TV/Filme","Lugar","Parte do corpo","O Tig é...","Transformice"}
ID = {cat=1,camada=2,add=3,msg=4,tempo=5,stop=6}
PLAYER = {}
ESCOLHA = {}
MODO = "inicio"
ROUND = 1
PALAVRA = 1
MAXROUND = 5
TEMPO = false
LETRA = ""

function atualizaCat(first)
local txt = "<p align='center'><font size='14px'>Selecione as categorias.</font></p>\n\n"
for i, v in pairs(CAT) do
txt = txt .. string.format("<j>- %s <r><a href='event:del %s'>[remover]</a>\n", v, v)
end
txt = txt .. "\n<vp>- <a href='event:add'>Adicionar</a>\n\n<rose><p align='center'><font size='16px'><a href='event:start'>Começar</a></p></font>"
for i, v in pairs(ADM) do
ui.addTextArea(ID.cat, txt, v, 300, 50, 200, 300, 1, 1, 0.8, true)
end
end

function atualizaPlayer()
local txt = ROUND <= MAXROUND and string.format("<p align='center'><font size='14px'>Round %d/%d\n</font></p><font size='9px'>", ROUND, MAXROUND) or "<p align='center'><font size='14px'>Placar final\n\n</font></p>"
local cont = 0
local total = 0
local player = {}
for i, v in pairs(PLAYER) do
table.insert(player, {nome = i, pontos = v.pontos, vitoria = v.vitoria, num = v.num})
end
table.sort(player, function(a, b) if a.pontos and b.pontos then return a.pontos > b.pontos end end)
for i, v in ipairs(player) do
txt = txt .. string.format("<%s>- %s - %d pontos %s\n", v.num and v.num > 0 and "vp" or "r", v.nome, v.pontos or 0, v.vitoria and v.vitoria > 0 and string.format("<j>- Vitórias: %d", v.vitoria) or "")
if v.num > 0 then
cont = cont + 1
end
total = total + 1
if total > 20 then
break
end
end
if cont == total then
TEMPO = os.time()+5000
end
ui.addTextArea(ID.cat, txt, nil, 300, 50, 200, 250, 1, 1, 0.8, true)
end

function split(txt)
local arg = {}
for i, v in string.gmatch(txt, "[%S]+") do
table.insert(arg, i)
end
return arg
end

function buscaItem(t, item)
for i, v in pairs(t) do
if v == item then
return i
end
end
return false
end

function buscaPalavra(item)
for i, v in pairs(ESCOLHA) do
if v.p == item then
return i
end
end
return false
end

function zeraTudo(zeraVitoria, zeraPontos)
for i, v in pairs(tfm.get.room.playerList) do
PLAYER[i] = PLAYER[i] or {}
PLAYER[i].num = 0
PLAYER[i].palavra = {}
for _, v in pairs(CAT) do
PLAYER[i].palavra[v] = ""
end
if zeraVitoria then
PLAYER[i].vitoria = 0
end
if zeraPontos then
PLAYER[i].pontos = 0
tfm.exec.setPlayerScore(i, 0, false)
end
end
end

function atualizaPalavras(p)
local cont = 0
for i, v in pairs(CAT) do
ui.addTextArea(i+1000, string.format("<p align='center'><a href='event:palavra %s'>%s\n<j><b>%s", i, v, PLAYER[p].palavra[v]), p, ((i-1)%5)*160+5, math.floor((i-1)/5)*55+150, 150, 45, 1, 1, 0.8, true)
if PLAYER[p].palavra[v] ~= "" then
cont = cont + 1
end
end
if cont == #CAT then
ui.addTextArea(ID.stop, "<p align='center'>Você foi muito rápido! Tempo para pedir stop: <r>" .. math.floor((TEMPO - os.time())/1000), p, 5, 375, 790, 20, 1, 1, 0.8, true)
end
end

function atualizaSeleciona(p)
for i, v in ipairs(ESCOLHA) do
ui.addTextArea(i+1000, string.format("<p align='center'><a href='event:escolha %d'><%s>%s", i, PLAYER[p].escolha[i] and "vp" or "r", v.p), p, ((i-1)%5)*160+5, math.floor((i-1)/5)*50+150, 150, 40, 1, 1, 0.8, true)

end
end

function selecionaPalavra()
for i=1, #ESCOLHA do
table.remove(ESCOLHA)
ui.removeTextArea(i+1000, nil)
end
for i, v in pairs(PLAYER) do
if v.palavra[CAT[PALAVRA]] ~= "" then
if buscaPalavra(v.palavra[CAT[PALAVRA]]) then
ESCOLHA[buscaPalavra(v.palavra[CAT[PALAVRA]])].pontos = 5
else
table.insert(ESCOLHA, {p = v.palavra[CAT[PALAVRA]], pontos = 10})
end
end
end
table.sort(ESCOLHA, function(a, b) return a.p < b.p end)
for i, v in pairs(PLAYER) do
v.escolha = {}
for j, x in pairs(ESCOLHA) do
table.insert(v.escolha, true)
end
end
ui.addTextArea(ID.cat, "<p align='center'><font size='30px'>" .. CAT[PALAVRA] .. " com " .. LETRA, nil, 5, 80, 790, 40, 1, 1, 0.8, true)
TEMPO = os.time() + 5000+(2000*#ESCOLHA)
ui.addTextArea(ID.tempo, "<r><p align='center'><font size='25px'>20</font></p>", nil, 380, 350, 40, 40, 1, 1, 0.8, true)
end

function eventChatCommand(p, cmd)
if cmd == "stop" and MODO == "round" and os.time() > TEMPO then
local cont = 0
for i, v in pairs(PLAYER[p].palavra) do
cont = v ~= "" and cont + 1 or cont
end
if cont == #CAT then
ui.removeTextArea(ID.stop, nil)
ui.removeTextArea(ID.cat, nil)
for i=1, #CAT do
ui.removeTextArea(i+1000, nil)
end
MODO = "fim"
PALAVRA = 1
ui.addTextArea(ID.msg, "<p align='center'>Clique nas palavras ERRADAS e marque de <r>vermelho <n> para anular seus pontos.", nil, 5, 50, 790, 20, 1, 1, 0.8, true)
ESCOLHA = {}
selecionaPalavra()
for i, v in pairs(PLAYER) do
atualizaSeleciona(i)
end
end
end
end

function eventTextAreaCallback(id, p, cmd)
local arg = split(cmd)
if #arg > 0 then
if arg[1] == "add" then
ui.addPopup(ID.add, 2, "Adicionar categoria", p, 300, 200, 200, true)
elseif arg[1] == "del" then
table.remove(CAT, buscaItem(CAT, table.concat(arg, " ", 2)))
atualizaCat(false)
elseif arg[1] == "start" then
MODO = "espera"
TEMPO = os.time()+40000
zeraTudo(true, true)
atualizaPlayer(true)
ui.addTextArea(ID.tempo, "<r><p align='center'><font size='25px'>40</font></p>", nil, 520, 50, 40, 40, 1, 1, 0.8, true)
ui.addTextArea(ID.msg, "<r><p align='center'>Escolha um número</p>", nil, 150, 320, 490, 20, 1, 1, 0.8, true)
for i=1, 10 do
ui.addTextArea(i+30, string.format("<p align='center'><font size='28px'><a href='event:num %d'>%d", i, i), nil, 150+((i-1)*50), 350, 40, 40, 1, 1, 0.8, true)
end
elseif arg[1] == "num" then
PLAYER[p].num = tonumber(arg[2],10)
atualizaPlayer(true)
for i=1, 10 do
ui.removeTextArea(i+30, p)
end
ui.removeTextArea(ID.msg, p)
elseif arg[1] == "palavra" then
ui.addPopup(tonumber(arg[2],10), 2, CAT[tonumber(arg[2],10)], p, 300, 200, 200, true)
elseif arg[1] == "escolha" then
PLAYER[p].escolha[tonumber(arg[2],10)] = PLAYER[p].escolha and not PLAYER[p].escolha[tonumber(arg[2],10)] or false
if PLAYER[p].escolha then
ui.addTextArea(tonumber(arg[2],10)+1000, string.format("<p align='center'><a href='event:escolha %d'><%s>%s", tonumber(arg[2],10), PLAYER[p].escolha and PLAYER[p].escolha[tonumber(arg[2],10)] and "vp" or "r", ESCOLHA[tonumber(arg[2],10)] and ESCOLHA[tonumber(arg[2],10)].p or ""), p, ((tonumber(arg[2],10)-1)%5)*160+5, math.floor((tonumber(arg[2],10)-1)/5)*50+150, 150, 40, 1, 1, 0.8, true)
end
if not PLAYER[p].escolha[tonumber(arg[2],10)] then
--tfm.exec.chatMessage("<r>"..p.." votou para negar "..ESCOLHA[tonumber(arg[2],10)].p)
end
end
end
end

function eventPopupAnswer(id, p, resp)
if id == ID.add and resp ~= "" and MODO == "inicio" then
if not buscaItem(CAT, resp) then
table.insert(CAT, resp)
atualizaCat(false)
end
elseif MODO == "round" and (string.upper(resp)):sub(1,1) == LETRA then
PLAYER[p].palavra[CAT[id]] = string.upper(resp)
atualizaPalavras(p)
end
end

function eventNewPlayer(p)
PLAYER[p] = {num = 0, pontos = 0, vitoria = 0, palavra = {}}
for i, v in pairs(CAT) do
PLAYER[p].palavra[v] = ""
end
if MODO == "espera" then
atualizaPlayer(true)
end
tfm.exec.respawnPlayer(p)
end

function eventPlayerLeft(p)
PLAYER[p] = nil
if MODO == "espera" then
atualizaPlayer(false)
end
end

function eventPlayerGetCheese(p)
tfm.exec.killPlayer(p)
tfm.exec.respawnPlayer(p)
end

function eventPlayerDied(p)
tfm.exec.respawnPlayer(p)
end

function eventLoop(current, remaining)
if MODO == "espera" then
local t = math.ceil((TEMPO - os.time())/1000)
ui.updateTextArea(ID.tempo, string.format("<r><p align='center'><font size='25px'>%d</font></p>", t), nil)
if os.time() > TEMPO then
MODO = "letra"
local txt = string.format("<p align='center'><font size='14px'>Round %d/%d\n</font></p><j><font size='9px'>", ROUND, MAXROUND)
local cont = 0
local player = {}
for i, v in pairs(PLAYER) do
table.insert(player, {nome = i, pontos = v.pontos, vitoria = v.vitoria, num = v.num})
end
table.sort(player, function(a, b) if a.pontos and b.pontos then return a.pontos > b.pontos end end)
for i, v in ipairs(player) do
txt = txt .. string.format("- %s escolheu %s\n", v.nome, v.num)
cont = cont + v.num
end
txt = txt .. "\n<p align='center'><rose>Soma: " .. cont
LETRA = string.char(cont%26 == 0 and 90 or cont%26+64)
ui.addTextArea(ID.cat, txt, nil, 300, 50, 200, 250, 1, 1, 0.8, true)
ui.removeTextArea(ID.tempo)
TEMPO = os.time()+10000
for i=1, 10 do
ui.removeTextArea(i+30, p)
end
ui.removeTextArea(ID.msg, p)
end
elseif MODO == "letra" then
if os.time() > TEMPO then
MODO = "round"
TEMPO = os.time()+30000+(5000*#CAT)
ui.removeTextArea(ID.cat, nil)
ui.addTextArea(ID.cat, string.format("<p align='center'>A letra é:\n<font size='50px'><rose>%s</rose></font></p>", LETRA), nil, 300, 50, 200, 80, 1, 1, 0.8, true)
for i, v in pairs(PLAYER) do
atualizaPalavras(i)
end
end
elseif MODO == "round" then
if os.time() > TEMPO then
ui.updateTextArea(ID.stop, "<p align='center'><rose>Digite <b>!stop</b> no chat.", nil)
else
ui.updateTextArea(ID.stop, "<p align='center'><n>Você foi muito rápido! Tempo para pedir stop: <r>" .. math.floor((TEMPO - os.time())/1000), nil)
end
elseif MODO == "fim" then
local t = math.ceil((TEMPO - os.time())/1000)
ui.updateTextArea(ID.tempo, string.format("<r><p align='center'><font size='25px'>%d</font></p>", t), nil)
if os.time() > TEMPO then
for i, v in pairs(ESCOLHA) do
local cont = 0
for j, x in pairs(PLAYER) do
if x.escolha then
cont = x.escolha[i] and cont + 1 or cont
end
end
ESCOLHA[i].pontos = cont*7 <= #PLAYER*8 and 0 or v.pontos
end
for i, v in pairs(PLAYER) do
if v.palavra[CAT[PALAVRA]] ~= "" then
v.pontos = v.pontos + ESCOLHA[buscaPalavra(v.palavra[CAT[PALAVRA]])].pontos
end
tfm.exec.setPlayerScore(i, v.pontos, false)
end
if PALAVRA < #CAT then
PALAVRA = PALAVRA + 1
selecionaPalavra()
for i, v in pairs(PLAYER) do
atualizaSeleciona(i)
end
elseif ROUND < MAXROUND then
ROUND = ROUND + 1
MODO = "espera"
TEMPO = os.time()+40000
zeraTudo(false, false)
atualizaPlayer(true)
ui.addTextArea(ID.tempo, "<r><p align='center'><font size='25px'>40</font></p>", nil, 520, 50, 40, 40, 1, 1, 0.8, true)
ui.addTextArea(ID.msg, "<r><p align='center'>Escolha um número</p>", nil, 150, 320, 490, 20, 1, 1, 0.8, true)
for i=1, 10 do
ui.addTextArea(i+30, string.format("<p align='center'><font size='28px'><a href='event:num %d'>%d", i, i), nil, 150+((i-1)*50), 350, 40, 40, 1, 1, 0.8, true)
end
for i, v in pairs(ESCOLHA) do
ui.removeTextArea(i+1000, nil)
end
else
ROUND = ROUND + 1
MODO = "vitoria"
TEMPO = os.time()+30000
atualizaPlayer()
local maior = 0
local n = ""
for i, v in pairs(PLAYER) do
if v.pontos and v.pontos > maior then
maior = v.pontos
n = i
end
end
PLAYER[n].vitoria = PLAYER[n].vitoria + 1
for i, v in pairs(ESCOLHA) do
ui.removeTextArea(i+1000, nil)
end
ui.removeTextArea(ID.msg, nil)
end
end
elseif MODO == "vitoria" then
for i=1, 50 do
tfm.exec.displayParticle(math.random(21,24), math.random(1,800), 20, math.random(-20,20)/100, math.random(10,1000)/100, 0, 0, nil)
end
if os.time() > TEMPO then
MODO = "espera"
TEMPO = os.time()+40000
ROUND = 1
zeraTudo(false, true)
atualizaPlayer(true)
ui.addTextArea(ID.tempo, "<r><p align='center'><font size='25px'>40</font></p>", nil, 520, 50, 40, 40, 1, 1, 0.8, true)
ui.addTextArea(ID.msg, "<r><p align='center'>Escolha um número</p>", nil, 150, 320, 490, 20, 1, 1, 0.8, true)
for i=1, 10 do
ui.addTextArea(i+30, string.format("<p align='center'><font size='28px'><a href='event:num %d'>%d", i, i), nil, 150+((i-1)*50), 350, 40, 40, 1, 1, 0.8, true)
end
end
end
end

tfm.exec.disableAfkDeath(true)
tfm.exec.disableAutoShaman(true)
tfm.exec.disableAutoScore(true)
tfm.exec.disableAutoNewGame(true)
tfm.exec.newGame("@630022")
atualizaCat(true)


voto só de admin

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
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
-- STOP
-- Escrito por Ninguem - 31/08/2015

ADM = {"Ninguem"}
CAT = {"Nome","Vegetal","Animal","Marca","Profissão","Objeto","TV/Filme","Lugar","Parte do corpo","O Tig é...","Transformice"}
ID = {cat=1,camada=2,add=3,msg=4,tempo=5,stop=6}
PLAYER = {}
ESCOLHA = {}
MODO = "inicio"
ROUND = 1
PALAVRA = 1
MAXROUND = 5
TEMPO = false
LETRA = ""

function atualizaCat(first)
local txt = "<p align='center'><font size='14px'>Selecione as categorias.</font></p>\n\n"
for i, v in pairs(CAT) do
txt = txt .. string.format("<j>- %s <r><a href='event:del %s'>[remover]</a>\n", v, v)
end
txt = txt .. "\n<vp>- <a href='event:add'>Adicionar</a>\n\n<rose><p align='center'><font size='16px'><a href='event:start'>Começar</a></p></font>"
for i, v in pairs(ADM) do
ui.addTextArea(ID.cat, txt, v, 300, 50, 200, 300, 1, 1, 0.8, true)
end
end

function atualizaPlayer()
local txt = ROUND <= MAXROUND and string.format("<p align='center'><font size='14px'>Round %d/%d\n</font></p><font size='9px'>", ROUND, MAXROUND) or "<p align='center'><font size='14px'>Placar final\n\n</font></p>"
local cont = 0
local total = 0
local player = {}
for i, v in pairs(PLAYER) do
table.insert(player, {nome = i, pontos = v.pontos, vitoria = v.vitoria, num = v.num})
end
table.sort(player, function(a, b) if a.pontos and b.pontos then return a.pontos > b.pontos end end)
for i, v in ipairs(player) do
txt = txt .. string.format("<%s>- %s - %d pontos %s\n", v.num and v.num > 0 and "vp" or "r", v.nome, v.pontos or 0, v.vitoria and v.vitoria > 0 and string.format("<j>- Vitórias: %d", v.vitoria) or "")
if v.num > 0 then
cont = cont + 1
end
total = total + 1
if total > 20 then
break
end
end
if cont == total then
TEMPO = os.time()+5000
end
ui.addTextArea(ID.cat, txt, nil, 300, 50, 200, 250, 1, 1, 0.8, true)
end

function split(txt)
local arg = {}
for i, v in string.gmatch(txt, "[%S]+") do
table.insert(arg, i)
end
return arg
end

function isAdm(p)
for i, v in pairs(ADM) do
if v == p then
return true
end
end
end

function buscaItem(t, item)
for i, v in pairs(t) do
if v == item then
return i
end
end
return false
end

function buscaPalavra(item)
for i, v in pairs(ESCOLHA) do
if v.p == item then
return i
end
end
return false
end

function zeraTudo(zeraVitoria, zeraPontos)
for i, v in pairs(tfm.get.room.playerList) do
PLAYER[i] = PLAYER[i] or {}
PLAYER[i].num = 0
PLAYER[i].palavra = {}
for _, v in pairs(CAT) do
PLAYER[i].palavra[v] = ""
end
if zeraVitoria then
PLAYER[i].vitoria = 0
end
if zeraPontos then
PLAYER[i].pontos = 0
tfm.exec.setPlayerScore(i, 0, false)
end
end
end

function atualizaPalavras(p)
local cont = 0
for i, v in pairs(CAT) do
ui.addTextArea(i+1000, string.format("<p align='center'><a href='event:palavra %s'>%s\n<j><b>%s", i, v, PLAYER[p].palavra[v]), p, ((i-1)%5)*160+5, math.floor((i-1)/5)*55+150, 150, 45, 1, 1, 0.8, true)
if PLAYER[p].palavra[v] ~= "" then
cont = cont + 1
end
end
if cont == #CAT then
ui.addTextArea(ID.stop, "<p align='center'>Você foi muito rápido! Tempo para pedir stop: <r>" .. math.floor((TEMPO - os.time())/1000), p, 5, 375, 790, 20, 1, 1, 0.8, true)
end
end

function atualizaSeleciona(p)
for i, v in ipairs(ESCOLHA) do
ui.addTextArea(i+1000, string.format("<p align='center'><a href='event:escolha %d'><%s>%s", i, PLAYER[p].escolha[i] and "vp" or "r", v.p), p, ((i-1)%5)*160+5, math.floor((i-1)/5)*50+150, 150, 40, 1, 1, 0.8, true)

end
end

function selecionaPalavra()
for i=1, #ESCOLHA do
table.remove(ESCOLHA)
ui.removeTextArea(i+1000, nil)
end
for i, v in pairs(PLAYER) do
if v.palavra[CAT[PALAVRA]] ~= "" then
if buscaPalavra(v.palavra[CAT[PALAVRA]]) then
ESCOLHA[buscaPalavra(v.palavra[CAT[PALAVRA]])].pontos = 5
else
table.insert(ESCOLHA, {p = v.palavra[CAT[PALAVRA]], pontos = 10})
end
end
end
table.sort(ESCOLHA, function(a, b) return a.p < b.p end)
for i, v in pairs(PLAYER) do
v.escolha = {}
for j, x in pairs(ESCOLHA) do
table.insert(v.escolha, true)
end
end
ui.addTextArea(ID.cat, "<p align='center'><font size='30px'>" .. CAT[PALAVRA] .. " com " .. LETRA, nil, 5, 80, 790, 40, 1, 1, 0.8, true)
TEMPO = os.time() + 5000+(2000*#ESCOLHA)
ui.addTextArea(ID.tempo, "<r><p align='center'><font size='25px'>20</font></p>", nil, 380, 350, 40, 40, 1, 1, 0.8, true)
end

function eventChatCommand(p, cmd)
if cmd == "stop" and MODO == "round" and os.time() > TEMPO then
local cont = 0
for i, v in pairs(PLAYER[p].palavra) do
cont = v ~= "" and cont + 1 or cont
end
if cont == #CAT then
ui.removeTextArea(ID.stop, nil)
ui.removeTextArea(ID.cat, nil)
for i=1, #CAT do
ui.removeTextArea(i+1000, nil)
end
MODO = "fim"
PALAVRA = 1
ui.addTextArea(ID.msg, "<p align='center'>Clique nas palavras ERRADAS e marque de <r>vermelho <n> para anular seus pontos.", nil, 5, 50, 790, 20, 1, 1, 0.8, true)
ESCOLHA = {}
selecionaPalavra()
for i, v in pairs(PLAYER) do
atualizaSeleciona(i)
end
end
end
end

function eventTextAreaCallback(id, p, cmd)
local arg = split(cmd)
if #arg > 0 then
if arg[1] == "add" then
ui.addPopup(ID.add, 2, "Adicionar categoria", p, 300, 200, 200, true)
elseif arg[1] == "del" then
table.remove(CAT, buscaItem(CAT, table.concat(arg, " ", 2)))
atualizaCat(false)
elseif arg[1] == "start" then
MODO = "espera"
TEMPO = os.time()+40000
zeraTudo(true, true)
atualizaPlayer(true)
ui.addTextArea(ID.tempo, "<r><p align='center'><font size='25px'>40</font></p>", nil, 520, 50, 40, 40, 1, 1, 0.8, true)
ui.addTextArea(ID.msg, "<r><p align='center'>Escolha um número</p>", nil, 150, 320, 490, 20, 1, 1, 0.8, true)
for i=1, 10 do
ui.addTextArea(i+30, string.format("<p align='center'><font size='28px'><a href='event:num %d'>%d", i, i), nil, 150+((i-1)*50), 350, 40, 40, 1, 1, 0.8, true)
end
elseif arg[1] == "num" then
PLAYER[p].num = tonumber(arg[2],10)
atualizaPlayer(true)
for i=1, 10 do
ui.removeTextArea(i+30, p)
end
ui.removeTextArea(ID.msg, p)
elseif arg[1] == "palavra" then
ui.addPopup(tonumber(arg[2],10), 2, CAT[tonumber(arg[2],10)], p, 300, 200, 200, true)
elseif arg[1] == "escolha" then
PLAYER[p].escolha[tonumber(arg[2],10)] = PLAYER[p].escolha and not PLAYER[p].escolha[tonumber(arg[2],10)] or false
if PLAYER[p].escolha then
ui.addTextArea(tonumber(arg[2],10)+1000, string.format("<p align='center'><a href='event:escolha %d'><%s>%s", tonumber(arg[2],10), PLAYER[p].escolha and PLAYER[p].escolha[tonumber(arg[2],10)] and "vp" or "r", ESCOLHA[tonumber(arg[2],10)] and ESCOLHA[tonumber(arg[2],10)].p or ""), p, ((tonumber(arg[2],10)-1)%5)*160+5, math.floor((tonumber(arg[2],10)-1)/5)*50+150, 150, 40, 1, 1, 0.8, true)
end
if not PLAYER[p].escolha[tonumber(arg[2],10)] then
--tfm.exec.chatMessage("<r>"..p.." votou para negar "..ESCOLHA[tonumber(arg[2],10)].p)
end
end
end
end

function eventPopupAnswer(id, p, resp)
if id == ID.add and resp ~= "" and MODO == "inicio" then
if not buscaItem(CAT, resp) then
table.insert(CAT, resp)
atualizaCat(false)
end
elseif MODO == "round" and (string.upper(resp)):sub(1,1) == LETRA then
PLAYER[p].palavra[CAT[id]] = string.upper(resp)
atualizaPalavras(p)
end
end

function eventNewPlayer(p)
PLAYER[p] = {num = 0, pontos = 0, vitoria = 0, palavra = {}}
for i, v in pairs(CAT) do
PLAYER[p].palavra[v] = ""
end
if MODO == "espera" then
atualizaPlayer(true)
end
tfm.exec.respawnPlayer(p)
end

function eventPlayerLeft(p)
PLAYER[p] = nil
if MODO == "espera" then
atualizaPlayer(false)
end
end

function eventPlayerGetCheese(p)
tfm.exec.killPlayer(p)
tfm.exec.respawnPlayer(p)
end

function eventPlayerDied(p)
tfm.exec.respawnPlayer(p)
end

function eventLoop(current, remaining)
if MODO == "espera" then
local t = math.ceil((TEMPO - os.time())/1000)
ui.updateTextArea(ID.tempo, string.format("<r><p align='center'><font size='25px'>%d</font></p>", t), nil)
if os.time() > TEMPO then
MODO = "letra"
local txt = string.format("<p align='center'><font size='14px'>Round %d/%d\n</font></p><j><font size='9px'>", ROUND, MAXROUND)
local cont = 0
local player = {}
for i, v in pairs(PLAYER) do
table.insert(player, {nome = i, pontos = v.pontos, vitoria = v.vitoria, num = v.num})
end
table.sort(player, function(a, b) if a.pontos and b.pontos then return a.pontos > b.pontos end end)
for i, v in ipairs(player) do
txt = txt .. string.format("- %s escolheu %s\n", v.nome, v.num)
cont = cont + v.num
end
txt = txt .. "\n<p align='center'><rose>Soma: " .. cont
LETRA = string.char(cont%26 == 0 and 90 or cont%26+64)
ui.addTextArea(ID.cat, txt, nil, 300, 50, 200, 250, 1, 1, 0.8, true)
ui.removeTextArea(ID.tempo)
TEMPO = os.time()+10000
for i=1, 10 do
ui.removeTextArea(i+30, p)
end
ui.removeTextArea(ID.msg, p)
end
elseif MODO == "letra" then
if os.time() > TEMPO then
MODO = "round"
TEMPO = os.time()+30000+(5000*#CAT)
ui.removeTextArea(ID.cat, nil)
ui.addTextArea(ID.cat, string.format("<p align='center'>A letra é:\n<font size='50px'><rose>%s</rose></font></p>", LETRA), nil, 300, 50, 200, 80, 1, 1, 0.8, true)
for i, v in pairs(PLAYER) do
atualizaPalavras(i)
end
end
elseif MODO == "round" then
if os.time() > TEMPO then
ui.updateTextArea(ID.stop, "<p align='center'><rose>Digite <b>!stop</b> no chat.", nil)
else
ui.updateTextArea(ID.stop, "<p align='center'><n>Você foi muito rápido! Tempo para pedir stop: <r>" .. math.floor((TEMPO - os.time())/1000), nil)
end
elseif MODO == "fim" then
local t = math.ceil((TEMPO - os.time())/1000)
ui.updateTextArea(ID.tempo, string.format("<r><p align='center'><font size='25px'>%d</font></p>", t), nil)
if os.time() > TEMPO then
for i, v in pairs(ESCOLHA) do
local cont = 0
for j, x in pairs(PLAYER) do
if isAdm(j) and x.escolha then
cont = x.escolha[i] and cont + 1 or cont
end
end
ESCOLHA[i].pontos = cont>0 and v.pontos or 0
end
for i, v in pairs(PLAYER) do
if v.palavra[CAT[PALAVRA]] ~= "" then
v.pontos = v.pontos + ESCOLHA[buscaPalavra(v.palavra[CAT[PALAVRA]])].pontos
end
tfm.exec.setPlayerScore(i, v.pontos, false)
end
if PALAVRA < #CAT then
PALAVRA = PALAVRA + 1
selecionaPalavra()
for i, v in pairs(PLAYER) do
atualizaSeleciona(i)
end
elseif ROUND < MAXROUND then
ROUND = ROUND + 1
MODO = "espera"
TEMPO = os.time()+40000
zeraTudo(false, false)
atualizaPlayer(true)
ui.addTextArea(ID.tempo, "<r><p align='center'><font size='25px'>40</font></p>", nil, 520, 50, 40, 40, 1, 1, 0.8, true)
ui.addTextArea(ID.msg, "<r><p align='center'>Escolha um número</p>", nil, 150, 320, 490, 20, 1, 1, 0.8, true)
for i=1, 10 do
ui.addTextArea(i+30, string.format("<p align='center'><font size='28px'><a href='event:num %d'>%d", i, i), nil, 150+((i-1)*50), 350, 40, 40, 1, 1, 0.8, true)
end
for i, v in pairs(ESCOLHA) do
ui.removeTextArea(i+1000, nil)
end
else
ROUND = ROUND + 1
MODO = "vitoria"
TEMPO = os.time()+30000
atualizaPlayer()
local maior = 0
local n = ""
for i, v in pairs(PLAYER) do
if v.pontos and v.pontos > maior then
maior = v.pontos
n = i
end
end
PLAYER[n].vitoria = PLAYER[n].vitoria + 1
for i, v in pairs(ESCOLHA) do
ui.removeTextArea(i+1000, nil)
end
ui.removeTextArea(ID.msg, nil)
end
end
elseif MODO == "vitoria" then
for i=1, 50 do
tfm.exec.displayParticle(math.random(21,24), math.random(1,800), 20, math.random(-20,20)/100, math.random(10,1000)/100, 0, 0, nil)
end
if os.time() > TEMPO then
MODO = "espera"
TEMPO = os.time()+40000
ROUND = 1
zeraTudo(false, true)
atualizaPlayer(true)
ui.addTextArea(ID.tempo, "<r><p align='center'><font size='25px'>40</font></p>", nil, 520, 50, 40, 40, 1, 1, 0.8, true)
ui.addTextArea(ID.msg, "<r><p align='center'>Escolha um número</p>", nil, 150, 320, 490, 20, 1, 1, 0.8, true)
for i=1, 10 do
ui.addTextArea(i+30, string.format("<p align='center'><font size='28px'><a href='event:num %d'>%d", i, i), nil, 150+((i-1)*50), 350, 40, 40, 1, 1, 0.8, true)
end
end
end
end

tfm.exec.disableAfkDeath(true)
tfm.exec.disableAutoShaman(true)
tfm.exec.disableAutoScore(true)
tfm.exec.disableAutoNewGame(true)
tfm.exec.newGame("@630022")
atualizaCat(true)
Roose
« Citoyen »
1518473160000
    • Roose#7190
    • Profil
    • Derniers messages
    • Tribu
#676
  0
Quando os últimos jogadores ficar vivo, aparecer na tela do tal jogador, Você venceu!
Bolodefchoco
« Sénateur »
1518475320000
    • Bolodefchoco#0095
    • Profil
    • Derniers messages
    • Tribu
#677
  0
Uhzinhooo a dit :
Quando os últimos jogadores ficar vivo, aparecer na tela do tal jogador, Você venceu!

Não tem como saber "os últimos jogadores vivos" porque não dá pra saber como, quando e se eles morrem. Há de ser mais específico, amigo =)

Abaixo está um script que apenas o ÚLTIMO sobrevivente é dito

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
local messaged = false

eventNewGame = function()
messaged = false
ui.removeTextArea(0)
end

jogadores = function()
local p = {}
for k, v in next, tfm.get.room.playerList do
if not v.isDead then
p[#p + 1] = k
end
end
return p
end

eventLoop = function()
if not messaged then
local p = jogadores()
if #p == 1 then
ui.addTextArea(0, "<p align='center'><font size='20'>" .. p[1] .. " é o último sobrevivente!", nil,5, 200, 795, nil, 1, 1, 0, true)
messaged = true
end
end
end
Mi_uk
« Citoyen »
1518478920000
    • Mi_uk#0000
    • Profil
    • Derniers messages
#678
  0
.Deixa quieto

Dernière modification le 1518478980000
Bolodefchoco
« Sénateur »
1518479340000
    • Bolodefchoco#0095
    • Profil
    • Derniers messages
    • Tribu
#679
  0
Mi_uk a dit :
.Deixa quieto

Não sinta-se envergonhado. Pode pedir, colega :D

Eu posso até fazer um bolo pra você

https://media.giphy.com/media/3o6Ztpe2hEveO3PPZm/giphy.gif

Mi_uk
« Citoyen »
1518513180000
    • Mi_uk#0000
    • Profil
    • Derniers messages
#680
  0
Kk deixa bolo só peço uma coisa o script que você fez de survivor com os meus mapas não está rodando corretamente, se você conseguir arrumar: O time, atalhos, e os pontos que são esses os problemas, agradecerei muito
  • Forums
  • /
  • Transformice
  • /
  • Archives
  • /
  • Seção Editor de Mapas e Modules
  • /
  • [Lua] Peça scripts aqui!
« ‹ 34 / 133 › »
© Atelier801 2018

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

Version 1.27