×

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!
« ‹ 111 / 133 › »
[Lua] Peça scripts aqui!
Lele007melan
« Citoyen »
1575680400000
    • Lele007melan#0000
    • Profil
    • Derniers messages
    • Tribu
#2201
  0
um script que o a pessoa selecionada (nome das pessoas) irao poder vira o tamanhoq eu quiser
Fly
« Citoyen »
1575734580000
    • Fly#8215
    • Profil
    • Derniers messages
    • Tribu
#2202
  0
Lele007melan a dit :
um script que o a pessoa selecionada (nome das pessoas) irao poder vira o tamanhoq eu quiser

Code Lua

1
2
3
4
5
6
7
8
9
local function changePlayerSize(size, ...)
size = tonumber(size) or 1

for _, v in next, { ... } do
tfm.exec.changePlayerSize(v, size)
end
end

changePlayerSize(2, 'Lele007melan#0000', 'Tigrounette#0001') -- Formato -> (tamanho, lista de jogadores)

Com a função changePlayerSize você pode alterar o tamanho de um ou mais jogadores.
O tamanho máximo é 5, o mínimo é 0.1.

Dernière modification le 1575734640000
Noobloops
« Citoyen »
1575893340000
    • Noobloops#0000
    • Profil
    • Derniers messages
    • Tribu
#2203
  1
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?
Rativect
« Citoyen »
1575931380000
    • Rativect#0000
    • Profil
    • Derniers messages
    • Tribu
#2204
  0
Script eliminatória x1 racing
Noobloops
« Citoyen »
1575945780000
    • Noobloops#0000
    • Profil
    • Derniers messages
    • Tribu
#2205
  0
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?
Fly
« Citoyen »
1575947520000
    • Fly#8215
    • Profil
    • Derniers messages
    • Tribu
#2206
  0
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()

Dernière modification le 1576009440000
Lele007melan
« Citoyen »
1575997800000
    • Lele007melan#0000
    • Profil
    • Derniers messages
    • Tribu
#2207
  0
estou aqui a pedir mais um script
gostaria de um script que a pessoa ficaria invisivel (mais so a pessoa que eu gostaria de colocar)
Kawaii
« Citoyen »
1576090200000
    • Kawaii#7574
    • Profil
    • Derniers messages
    • Tribu
#2208
  0
Quero um script que os ratos joguem vôlei
Noobloops
« Citoyen »
1576201020000
    • Noobloops#0000
    • Profil
    • Derniers messages
    • Tribu
#2209
  0
Um script no qual aparece uma tela grande no meio do cafofo (tipo uma caixa de texto) na qual somente EU como administrador, poderei escrever e enviar mensagens para que todos os presentes no cafofo possam ver, seria possível?
Fly
« Citoyen »
1576204140000
    • Fly#8215
    • Profil
    • Derniers messages
    • Tribu
#2210
  0
Noobloops a dit :
Um script no qual aparece uma tela grande no meio do cafofo (tipo uma caixa de texto) na qual somente EU como administrador, poderei escrever e enviar mensagens para que todos os presentes no cafofo possam ver, seria possível?

Code Lua

1
2
3
4
5
6
7
8
9
10
11
local admin = 'Noobloops#0000'

ui.addPopup(0, 2, "<p align='center'>Mensagem", admin, 300, 150)

function eventPopupAnswer(_, player, answer)
if (#answer > 0) then
ui.addTextArea(0, string.format('<v>[%s]</v> %s', player, answer), nil, 5, 25, 790, nil, nil, 0, .8, true)
end

ui.addPopup(0, 2, "<p align='center'>Mensagem", player, 300, 150)
end
Jp_darkuss
« Citoyen »
1576535760000
    • Jp_darkuss#4806
    • Profil
    • Derniers messages
#2211
  0
Preciso de ajuda com umas funções. Eu comecei programar em Javascript, e conheço dois comandos MUITO IMPORTANTES, ou falar sobre eles.

Code Javascript

1
2
3
4
5
6
7
8
9
10
11
setTimeout(
function() {
//bloco;
}, int
); //primeiro comando

setInterval(
function() {
//bloco;
}, int
) //segundo comando

O primeiro comando (setTimeout()) consegue rodar sozinho sem afetar o resto do programa, assim como o segundo (setInterval()). O setTimeout() executa os comandos no bloco depois de se passar um certo tempo, expresso em milisegundos (int), ou seja, atrasa a execução. O setInterval() consegue fazer um loop, executando o bloco a cada (int) milisegundos. Minha pergunta é: existe alguma forma em Lua de produzir exatamente ou aproximadamente as ações das funções Javascript acima?
Victorck6
« Citoyen »
1576778220000
    • Victorck6#6662
    • Profil
    • Derniers messages
    • Tribu
#2212
  0
Script pra fazer amigo secreto
Jp_darkuss
« Citoyen »
1576878540000
    • Jp_darkuss#4806
    • Profil
    • Derniers messages
#2213
  1
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.

Dernière modification le 1576878780000
Conceptismo
« Citoyen »
1577031360000
    • Conceptismo#2978
    • Profil
    • Derniers messages
#2214
  0
Alguém poderia me arranjar um script em que reinicie a partida quando o shaman fala alguma palavra específica no chat?
Fly
« Citoyen »
1577031780000
    • Fly#8215
    • Profil
    • Derniers messages
    • Tribu
#2215
  0
Conceptismo a dit :
Alguém poderia me arranjar um script em que reinicie a partida quando o shaman fala alguma palavra específica no chat?

Code Lua

1
2
3
4
5
6
7
function eventChatMessage(player, message)
if (not tfm.get.room.playerList[player].isShaman) then return end

if (message == "Palavra") then
tfm.exec.newGame(tfm.get.room.currentMap)
end
end
Conceptismo
« Citoyen »
1577032080000
    • Conceptismo#2978
    • Profil
    • Derniers messages
#2216
  0
Valeu, meu consagrado
Conceptismo
« Citoyen »
1577136480000
    • Conceptismo#2978
    • Profil
    • Derniers messages
#2217
  0
Alguém poderia me arranjar um script que escolha um jogador aleatório na sala pra ser Shaman quando todos estiverem com 0 pontos?
Fly
« Citoyen »
1577156160000
    • Fly#8215
    • Profil
    • Derniers messages
    • Tribu
#2218
  0
Conceptismo a dit :
Alguém poderia me arranjar um script que escolha um jogador aleatório na sala pra ser Shaman quando todos estiverem com 0 pontos?

Code Lua

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
function eventNewGame()
local players = { }

for k, v in next, tfm.get.room.playerList do
if (v.score > 0) then
return
end

if (v.isShaman) then
tfm.exec.setShaman(k, false)
end

players[#players + 1] = k
end

tfm.exec.setShaman(players[math.random(#players)])
end
Locke
« Citoyen »
1577189040000
    • Locke#8056
    • Profil
    • Derniers messages
    • Tribu
#2219
  0
Obrigado!!!
E uma perguntinha, tem como ativar esse recurso só quando todos os ratos da sala estiverem com 0 pontos?
É que meus amigos estão criando um script de perguntas que o shaman faz a pergunta, e sempre tá caindo no mesmo shaman :/
Fly
« Citoyen »
1577202060000
    • Fly#8215
    • Profil
    • Derniers messages
    • Tribu
#2220
  0
Locke a dit :
Obrigado!!!
E uma perguntinha, tem como ativar esse recurso só quando todos os ratos da sala estiverem com 0 pontos?
É que meus amigos estão criando um script de perguntas que o shaman faz a pergunta, e sempre tá caindo no mesmo shaman :/

Na verdade já é ativado somente quando todos os jogadores estão com 0 pontos, como foi pedido lá em cima.

Quanto todos estão com a pontuação zerada, o próximo mapa que rodar terá um shaman aleatório. Pra esse tipo de script recomendo um outro tipo de sistema. Me chama por mensagem privada

Dernière modification le 1577202180000
  • Forums
  • /
  • Transformice
  • /
  • Archives
  • /
  • Seção Editor de Mapas e Modules
  • /
  • [Lua] Peça scripts aqui!
« ‹ 111 / 133 › »
© Atelier801 2018

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

Version 1.27