×

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!
« ‹ 4 / 133 › »
[Lua] Peça scripts aqui!
Fly
« Citoyen »
1487937840000
    • Fly#8215
    • Profil
    • Derniers messages
    • Tribu
#61
  0
Andreymarmo a dit :
eu queria pedir um lua que possibilita desenhar(tipo aqls itens de pincel) e apagar os desenhos no fundo do mapa.

Não é igual ao item de pincel do jogo mas te possibilita a desenhar. Para ativar escreva no chat !draw on

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
desenhistas = {}
for name,player in pairs(tfm.get.room.playerList) do
system.bindMouse(name,true)
desenhistas[name]=false
end

id=0
color = "0xFFFFFF"
size=1

function eventChatCommand(name,cmd)
local args={}
for arg in cmd:gmatch("[^%s]+") do
table.insert(args,arg)
end
if cmd=="clear" then
for i=1,id do
ui.removeTextArea(i)
end
elseif args[1]=="color" then
color="0x"..args[2]
elseif args[1]=="size" and tonumber(args[2])<=60 then
size=args[2]
elseif args[1]=="draw" then
if args[2] == "on" and desenhistas[name] == false then
desenhistas[name]=true
elseif args[2] == "off" and desenhistas[name] then
desenhistas[name]=false
end
end
end

function eventMouse(name,x,y)
if desenhistas[name] then
id = id + 1
ui.addTextArea(id, "", nil, x, y, size, size, color, color)
end
end

-- !color Cor selecionada para desenhar.
-- !size Tamanho escolhido para o pincel. O máximo é 60.
-- !clear Apaga o desenho.
-- !draw on/off Ativa/Desativa.

Comandos:

!color Cor selecionada para desenhar.
!size Tamanho escolhido para o pincel. O máximo é 60.
!clear Apaga o desenho.
!draw on/off Ativa/Desativa o desenho.
Vitor3539
« Citoyen »
1488227400000
    • Vitor3539#0000
    • Profil
    • Derniers messages
    • Tribu
#62
  0
um script que quando o rato aperte [T] ele comece a jogar baiacus que quando encostam em algo ou alguém solte um meep
Jajhjul
« Citoyen »
1488288000000
    • Jajhjul#0000
    • Profil
    • Derniers messages
#63
  0
Lucasrslv a dit :
um script em que todos tenham meep

[url=
a dit :

][/url]for name,player in pairs(tfm.get.room.playerList) do
tfm.exec.giveMeep(name)
end
Hugotitas
« Citoyen »
1488300480000
    • Hugotitas#0000
    • Profil
    • Derniers messages
    • Tribu
#64
  0
Jajhjul a dit :
Lucasrslv a dit :
um script em que todos tenham meep

[url=
a dit :

][/url]for name,player in pairs(tfm.get.room.playerList) do
tfm.exec.giveMeep(name)
end

O certo é
for name in pairs(tfm.get.room.playerList) do
tfm.exec.giveMeep(name)
end
Brenower
« Censeur »
1488301500000
    • Brenower#0000
    • Profil
    • Derniers messages
    • Tribu
#65
  0
Os dois estão corretos, e o pedido já tinha sido respondido.
Por favor, não atrapalhem no tópico.
Ghost
« Censeur »
1488397200000
    • Ghost#4078
    • Profil
    • Derniers messages
    • Tribu
#66
  0
Olá, poderiam fazer um script para mim? Ele é bem simples, algo mais ou menos assim: Quando você aperta a barra de espaço você faz uma emoção(como a do marshmellow). Isso, para todas da sala. Agradeço quem fazer!
Laagaadoo
« Citoyen »
1488397680000
    • Laagaadoo#0000
    • Profil
    • Derniers messages
    • Tribu
#67
  0
Snownevo a dit :
Olá, poderiam fazer um script para mim? Ele é bem simples, algo mais ou menos assim: Quando você aperta a barra de espaço você faz uma emoção(como a do marshmellow). Isso, para todas da sala. Agradeço quem fazer!

Code Lua

1
2
3
4
5
6
7
8
9
for name in pairs(tfm.get.room.playerList) do
system.bindKeyboard(name, 32, true)
end

function eventKeyboard(name, key)
if key == 32 then
tfm.exec.playEmote(name, tfm.enum.emote.marshmallow)
end
end
Ghost
« Censeur »
1488418800000
    • Ghost#4078
    • Profil
    • Derniers messages
    • Tribu
#68
  0
Laagaadoo a dit :
Snownevo a dit :
Olá, poderiam fazer um script para mim? Ele é bem simples, algo mais ou menos assim: Quando você aperta a barra de espaço você faz uma emoção(como a do marshmellow). Isso, para todas da sala. Agradeço quem fazer!

Code Lua

1
2
3
4
5
6
7
8
9
for name in pairs(tfm.get.room.playerList) do
system.bindKeyboard(name, 32, true)
end

function eventKeyboard(name, key)
if key == 32 then
tfm.exec.playEmote(name, tfm.enum.emote.marshmallow)
end
end

Obrigado! http://i.imgur.com/oxVfm.png
Lil
« Citoyen »
1488506040000
    • Lil#3791
    • Profil
    • Derniers messages
    • Tribu
#69
  0
script de x1 de times em vanilla
Ghost
« Censeur »
1488556200000
    • Ghost#4078
    • Profil
    • Derniers messages
    • Tribu
#70
  0
Abrir um pop-up escrito: Bem-vindo. Sempre que alguém entrar no cafofo da tribo.
Fly
« Citoyen »
1488559440000
    • Fly#8215
    • Profil
    • Derniers messages
    • Tribu
#71
  0
Snownevo a dit :
Abrir um pop-up escrito: Bem-vindo. Sempre que alguém entrar no cafofo da tribo.

Code Lua

1
2
3
function eventNewPlayer(name)
ui.addPopup(0, 0, "Bem-vindo(a).", name, 300, 150)
end
Ghost
« Censeur »
1488559740000
    • Ghost#4078
    • Profil
    • Derniers messages
    • Tribu
#72
  0
Flyingwr a dit :
Snownevo a dit :
Abrir um pop-up escrito: Bem-vindo. Sempre que alguém entrar no cafofo da tribo.

Code Lua

1
2
3
function eventNewPlayer(name)
ui.addPopup(0, 0, "Bem-vindo(a).", name, 300, 150)
end

Obrigado!
Mwmmwwwmmmmmmmw
« Citoyen »
1488585720000
    • Mwmmwwwmmmmmmmw#9040
    • Profil
    • Derniers messages
    • Tribu
#73
  0
Um sistema, se tal jogador fizer 100 pontos aparecerá uma mensagem no chat: Tal jogador venceu a partida!
Lcemt
« Citoyen »
1488588420000
    • Lcemt#0000
    • Profil
    • Derniers messages
    • Tribu
#74
  0
Code Lua

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
function score()
sc={}
for n,d in pairs(tfm.get.room.playerList) do
table.insert(sc,{
a=n,
b=d.score
})
end
table.sort(sc,function(a,b) return a.b>b.b end)
return sc[1]
end

function eventLoop()
player=score()
if player.b >= 100 then
ui.addPopup(0,0,player["a"].."venceu a partida!")
tfm.exec.setPlayerScore(player.a,0)
end
end
Acho que é assim

Dernière modification le 1488589080000
Judapz
« Citoyen »
1488588780000
    • Judapz#0000
    • Profil
    • Derniers messages
    • Tribu
#75
  0
Gostaria de um script que você aperta espaço e invoca tal item ou "taca" tal item do inventário como: Baiacu ou bola de neve sabe ?

Dernière modification le 1488588840000
Mwmmwwwmmmmmmmw
« Citoyen »
1488590520000
    • Mwmmwwwmmmmmmmw#9040
    • Profil
    • Derniers messages
    • Tribu
#76
  0
Lcemt a dit :
Code Lua

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
function score()
sc={}
for n,d in pairs(tfm.get.room.playerList) do
table.insert(sc,{
a=n,
b=d.score
})
end
table.sort(sc,function(a,b) return a.b>b.b end)
return sc[1]
end

function eventLoop()
player=score()
if player.b >= 100 then
ui.addPopup(0,0,player["a"].."venceu a partida!")
tfm.exec.setPlayerScore(player.a,0)
end
end
Acho que é assim

Valeu
Fly
« Citoyen »
1488625620000
    • Fly#8215
    • Profil
    • Derniers messages
    • Tribu
#77
  0
  • Losqa
  • Judapz
Losqa a dit :
script de x1 de times em vanilla

Você pode fazer isso com o Script x1 da galeria do Eshkation.

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
---
-- RACING 3VS3
-- Escrito por Eshkation 23/06/2016
-- the cake is not a lie
---

tfm.exec.disableAutoShaman()
tfm.exec.disableAutoNewGame()
tfm.exec.disableAutoTimeLeft()

local ADMINISTRADOR = "Losqa" -- CHANGE TO YOUR NICKNAME, SO YOU WILL BE GAME ADMIN
local WINS = 10 -- POINTS TO WIN THE GAME
system.disableChatCommandDisplay("np", true)
system.disableChatCommandDisplay("pause", true)

--[[
After running the script, use the command !team1 Players and !team2 Players to set both players in the specified team
Then you just need to press GO!
Type !np @mapcode to run the next map.
Type !score team1/team2 number to change its score.
Type !pause to pause/unpause the game.
]]

local teams = {
[1] = {},
[2] = {},
}
local points = {
[1] = 0,
[2] = 0,
}
local isfirst = false
local gameRunning = false
local winTime = false
local playersInGame = {}
local maps = {
2,10,11,12,19,22,24,26,44,45,49,53,55,58,67,69,70,74,79,80,119,123,138,71,86,37,40,41,42,43
}
local colors = {
[1] = "ff6347",
[2] = "19b5fe"
}
local queue = {}

function newMap()
local mapcode = maps[math.random(#maps)]
if #queue > 0 then
mapcode = queue[1]
table.remove(queue, 1)
end
tfm.exec.newGame(mapcode)
for player, data in pairs(tfm.get.room.playerList) do
if not playersInGame[player] then
tfm.exec.killPlayer(player)
end
end
tfm.exec.setGameTime(60)
end

function eventPlayerWon(player)
if not isfirst then
isfirst = true
tfm.exec.setGameTime(5)
if table.contains(teams[1], player) then
tfm.exec.setGameTime(5)
for i = 0, 3 do
defaultEffect(9, {13}, math.random(800), math.random(400), 20)
end
points[1] = points[1]+1
elseif table.contains(teams[2], player) then
tfm.exec.setGameTime(5)
for i = 0, 3 do
defaultEffect(9, {9}, math.random(800), math.random(400), 20)
end
points[2] = points[2]+1
else
isfirst = false
end
winner = false
if points[1] >= WINS then
winner = 1
elseif points[2] >= WINS then
winner = 2
end
if winner then
gameRunning = false
winTime = os.time()
local names = {
"Night's watch",
"Apace"
}
ui.addTextArea(20, string.format("<p align='center'><font size='37' color='#000000'>Team %s is the winner!\nGood job!", names[winner]), nil, 0, 171, 800, 500, 0, 0, 0, true)
ui.addTextArea(21, string.format("<p align='center'><font size='37' color='#000000'>Team %s is the winner!\nGood job!", names[winner]), nil, 1, 170, 800, 500, 0, 0, 0, true)
ui.addTextArea(22, string.format("<p align='center'><font size='37'><font color='#FFFFFF'>Team <font color='#%s'>%s</font> is the winner!\nGood job!", colors[winner], names[winner]), nil, 1, 170, 800, 500, 0, 0, 0, true)
end
displayScore()
end
end

function eventLoop(elapsed, remain)
if gameRunning then
remain = remain/1000
if remain < 0 then
remain = 100
newMap()
end
else
if winTime then
if winTime > os.time()-30000 then
for i = 0, 2 do
defaultEffect(9, {11, 9, 0, 13}, math.random(800), math.random(400), 80)
end
else
winTime = false
ui.removeTextArea(20)
ui.removeTextArea(21)
ui.removeTextArea(22)
displayTeams()
teams = {
[1] = {},
[2] = {},
}
points = {
[1] = 0,
[2] = 0,
}
playersInGame = {}
end
end
end
end

function string.title(s)
return string.gsub(s, "%a", function(c)
return string.upper(c)
end, 1)
end

function eventChatCommand(player, command)
if player:lower() == ADMINISTRADOR:lower() then
args = string.split(command, " ")
if args[1] == "team1" then
table.remove(args, 1)
teams[1] = {}
points[1] = 0
for index, player in pairs(args) do
player = string.title(player)
table.insert(teams[1], player)
playersInGame[player] = true
end
displayTeams()

elseif args[1] == "team2" then
table.remove(args, 1)
teams[2] = {}
points[2] = 0
for index, player in pairs(args) do
player = string.title(player)
table.insert(teams[2], player)
playersInGame[player] = true
end
displayTeams()

elseif args[1] == "score" then
if args[2] and args[3] then
local team = tonumber(args[2]:match("team(%d+)") or 0)
if team > 0 and team < 3 then
local newScore = tonumber(args[3]) or points[team]
points[team] = newScore
displayScore()
end
end
elseif args[1] == "np" then
if args[2] then
table.insert(queue, args[2])
end
elseif args[1] == "pause" then
gameRunning = not gameRunning
if not gameRunning then
ui.addTextArea(90, "<p align='center'><font size='25'><R>P A U S E D", nil, 0, 200, 800, nil, 0, 0, 0, true)
tfm.exec.disableAutoTimeLeft(true)
else
ui.removeTextArea(90)
tfm.exec.disableAutoTimeLeft(false)
end
end
end
end

function eventNewGame()
if gameRunning then
isfirst = false
for i, p in pairs(teams[1]) do
tfm.exec.setNameColor(p, "0x"..colors[1])
end
for i, p in pairs(teams[2]) do
tfm.exec.setNameColor(p, "0x"..colors[2])
end
displayScore()
end
end

function displayScore()
ui.addTextArea(17, string.format("<p align='center'><font size='23' color='#000000'>%s x %s", points[1], points[2]), nil, 0, 21, 800, 30, 0, 0, 0, true)
ui.addTextArea(18, string.format("<p align='center'><font size='23' color='#000000'>%s x %s", points[1], points[2]), nil, 1, 20, 800, 30, 0, 0, 0, true)
ui.addTextArea(19, string.format("<p align='center'><font size='23'><font color='#%s'>%s<N> x <font color='#%s'>%s", colors[1], points[1], colors[2], points[2]), nil, 0, 20, 800, 30, 0, 0, 0, true)
end

function displayTeams()
ui.addTextArea(1, "", nil, 199, 69, 400, 260, 0x5A7A8B, 0x5A7A8B, 1, true)
ui.addTextArea(2, "", nil, 201, 71, 400, 260, 0x0E1417, 0x0E1417, 1, true)
ui.addTextArea(3, "", nil, 200, 70, 400, 260, 0x324650, 0x324650, 1, true)
ui.addTextArea(4, "", nil, 209, 79, 142, 22, 0x324650, 0x5A7A8B, 1, true)
ui.addTextArea(5, "<p align='center'><V>Team 1", nil, 210, 80, 140, 20, 0x324650, 0x324650, 1, true)
ui.addTextArea(6, "", nil, 449, 79, 142, 22, 0x324650, 0x5A7A8B, 1, true)
ui.addTextArea(7, "<p align='center'><V>Team 2", nil, 450, 80, 140, 20, 0x324650, 0x324650, 1, true)
ui.addTextArea(8, "<p align='center'><font color='#5A7A8B'>|</font>", nil, 210, 102, 140, 200, 0, 0, 0, true)
ui.addTextArea(9, "<p align='center'><font color='#5A7A8B'>|</font>", nil, 450, 102, 140, 200, 0, 0, 0, true)
ui.addTextArea(10, "", nil, 209, 120, 140, 200, 0x5A7A8B, 0x5A7A8B, 1, true)
ui.addTextArea(11, "<p align='center'><font color='#"..colors[1].."'>"..table.concat(teams[1], "\n"), nil, 210, 121, 138, 198, 0x324650, 0x324650, 1, true)
ui.addTextArea(12, "", nil, 451, 120, 140, 200, 0x5A7A8B, 0x5A7A8B, 1, true)
ui.addTextArea(13, "<p align='center'><font color='#"..colors[2].."'>"..table.concat(teams[2], "\n"), nil, 452, 121, 138, 198, 0x324650, 0x324650, 1, true)
ui.addTextArea(14, "<p align='center'><font color='#5A7A8B'>____ ____</font>", nil, 330, 200, 140, 200, 0, 0, 0, true)
ui.addTextArea(15, "", nil, 380, 202, 40, 20, 0x5A7A8B, 0x5A7A8B, 1, true)
ui.addTextArea(16, "<p align='center'><V>VS", nil, 381, 203, 38, 18, 0x324650, 0x324650, 1, true)
ui.addTextArea(16, "<p align='center'><V><a href='event:iniciarJogo'>GO", ADMINISTRADOR, 381, 203, 38, 18, 0x324650, 0x324650, 1, true)
end

function eventTextAreaCallback(id, player, callback)
if callback == 'iniciarJogo' then
if #teams[2] > 0 and #teams[1] > 0 then
gameRunning = true
for i = 1, 16 do
ui.removeTextArea(i)
end
defaultEffect(9, {9}, 400, 212, 80)
newMap()
end
end
end

function string.split(s, pattern, n)
local st = {}
for sb in string.gmatch(s, "[^"..pattern.."]+") do
if not n or n > -1 then
table.insert(st,sb)
else
st[#st] = st[#st]..pattern..sb
end
n = n and n-1 or false
end
return st
end

function table.contains(tableT, element)
for _, value in pairs(tableT) do
if value == element then
return true
end
end
return false
end

defaultEffect=function(id,p,x,y,rand) -- thanks for the function santah
local minDist = 1
local outerBorder = 20
local maxDist = 30
local totalParticles = rand and 40 or (id == -1 and 35 or 75)
for i = 1, totalParticles do
if rand then
id = p[math.random(#p)]
end
local dist = math.min(math.random(minDist, maxDist), outerBorder)
local angle = math.random(0, 360)
local r = math.rad(angle)
local dx = math.cos(r)
local dy = math.sin(r)
local vx = dist * dx / 10
local vy = dist * dy / 10
local ax = -vx / dist / 15
local ay = (-vy / dist / 15) + 0.05
if id == -1 then
tfm.exec.displayParticle(9, x + dx, y + dy, vx, vy, ax, ay, nil)
tfm.exec.displayParticle(1, x + dx, y + dy, vx, vy, ax, ay, nil)
else
tfm.exec.displayParticle(id, x + dx, y + dy, vx, vy, ax, ay, nil)
end
end
end

displayTeams()

function eventPlayerDied()
local alive = 0
for k,v in pairs(tfm.get.room.playerList) do
if not v.isDead then
alive = alive+1
end
end
if alive < 2 then
tfm.exec.setGameTime(5)
end
end


Não tem todos os mapas da sala vanilla, por isso, se quiser adicionar mais algum, obtenha o código do mapa e adicione na tabela local maps.
Judapz a dit :
Gostaria de um script que você aperta espaço e invoca tal item ou "taca" tal item do inventário como: Baiacu ou bola de neve sabe ?

Script:

Code Lua

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
local o = {65,34} -- ID dos objetos baiacu e bola de neve

for p in pairs(tfm.get.room.playerList) do
tfm.exec.bindKeyboard(p, 32, true, true)
end

function eventKeyboard(name, key, down, x, y)
if key == 32 then
if tfm.get.room.playerList[name].isFacingRight then
tfm.exec.addShamanObject(o[math.random(#o)], x+20, y-5, 0, 8, 0)
else
tfm.exec.addShamanObject(o[math.random(#o)], x-20, y-5, 0, -8, 0)
end
end
end
Mwmmwwwmmmmmmmw
« Citoyen »
1488635460000
    • Mwmmwwwmmmmmmmw#9040
    • Profil
    • Derniers messages
    • Tribu
#78
  0
Gostaria de script de perfil com vitórias e pontos.
Hugotitas
« Citoyen »
1488643620000
    • Hugotitas#0000
    • Profil
    • Derniers messages
    • Tribu
#79
  0
Como faço pra fazer uma textArea clicável, mas só pode clica nela se tiver perto
Fly
« Citoyen »
1488648060000
    • Fly#8215
    • Profil
    • Derniers messages
    • Tribu
#80
  0
  • Hugotitas
  • Vitordiaspas
Hugotitas a dit :
Como faço pra fazer uma textArea clicável, mas só pode clica nela se tiver perto

Atualizado.

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
local xu, yu = 350, 290
local clicavel = false

function addText(name)
if not clicavel then
ui.addTextArea(0, "Clique aqui", name, xu, yu)
else
ui.addTextArea(0, "<a href='event:click'>Clique aqui</a>", name, xu, yu)
end
end

addText(nil)

function eventLoop()
for k,v in pairs(tfm.get.room.playerList) do
if math.floor((v.x + xu)/2+15) >= xu and math.floor((v.x + xu)/2-15) <= xu and math.floor((v.y + yu)/2+10) >= yu and math.floor((v.y + yu)/2-10) <= yu then
clicavel = true
addText(k)
else
clicavel = false
addText(k)
end
end
end
Vitordiaspas a dit :
Gostaria de script de perfil com vitórias e pontos.

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
data = {}

function eventNewPlayer(name)
if not data[name] then -- Armazena dados de um novo jogador na sala
data[name] = {
wins = 0, -- Cria o dado wins do novo jogador
score = tfm.get.room.playerList[name].score -- Cria o dado score do novo jogador
}
end
end

function eventChatCommand(name, cmd)
local args = {}
for arg in cmd:gmatch("[^%s]+") do
table.insert(args,arg)
end

if args[1] == "p" then -- Comando !p [NomeDoJogador]
if args[2] then
player = args[2]:lower():gsub('%a', string.upper, 1)
else
player = name
end
eventProfile(name,player)
end
end

function eventProfile(name,player) -- Função que abre o perfil de um jogador
ui.addTextArea(1, "", player, 299, 74, 200, 164, 0x7d8d99, 0x7d8d99, 1, true)
ui.addTextArea(2, "", player, 301, 76, 200, 164, 0x000001, 0x000001, 1, true)
ui.addTextArea(3, "<p align='center'>\n\n\n\n\n<font size='16'>Vitórias: <vp>"..data[player].wins.."</vp>\nPontos: <vp>"..data[player].score.."</vp>\n", player, 300, 75, 200, 164, 0x2c373d, 0x2c373d, 1, true)
ui.addTextArea(4, "", player, 309, 84, 180, 25, 0x000001, 0x000001, 1, true)
ui.addTextArea(5, "", player, 311, 86, 180, 25, 0x7d8d99, 0x7d8d99, 1, true)
ui.addTextArea(6, "<p align='center'><v><font size='18'>"..player.."", player, 310, 85, 180, 25, 0x1e272b, 0x1e272b, 1, true)
ui.addTextArea(7, "", player, 309, 204, 180, 25, 0x000001, 0x000001, 1, true)
ui.addTextArea(8, "", player, 311, 206, 180, 25, 0x7d8d99, 0x7d8d99, 1, true)
ui.addTextArea(9, "<p align='center'><r><font size='18'><a href='event:closeprofile'>Fechar</a>", player, 310, 205, 180, 25, 0x1e272b, 0x1e272b, 1, true)
end

function eventTextAreaCallback(id, name, link)
if link == "closeprofile" then
for id = 1, 9 do
ui.removeTextArea(id, name)
end
end
end

function eventPlayerWon(name) -- Se um jogador ganhar, será adicionado +1 vitória e alguns pontos em seus dados
data[name].wins = data[name].wins + 1
data[name].score = tfm.get.room.playerList[name].score
end

for p in pairs(tfm.get.room.playerList) do -- Armazena os dados de todos os jogadores da sala
eventNewPlayer(p)
end

Comando adicionado: !p para ver o perfil de algum jogador.

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

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

Version 1.27