×

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!
« ‹ 17 / 133 › »
[Lua] Peça scripts aqui!
Fly
« Citoyen »
1503577260000
    • Fly#8215
    • Profil
    • Derniers messages
    • Tribu
#321
  0
Travonrodfer a dit :
Eu quero um script que ao apertar P o score sobe mais um e o total desse score aparecesse em um textarea

Script
Code Lua

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
function eventNewPlayer(name)
system.bindKeyboard(name, 80, true)
tfm.exec.setPlayerScore(name, 0)
ui.addTextArea(0, string.format("Score: %s", tfm.get.room.playerList[name].score), name)
end
table.foreach(tfm.get.room.playerList, eventNewPlayer)

function eventKeyboard(name, key)
if key == 80 then
tfm.exec.setPlayerScore(name, 1, true)
ui.addTextArea(0, string.format("Score: %s", tfm.get.room.playerList[name].score), name)
end
end

function eventLoop()
table.foreach(tfm.get.room.playerList, function(k,v)
ui.addTextArea(0, string.format("Score: %s", v.score), k)
end)
end
Travonrodfer
« Censeur »
1503598320000
    • Travonrodfer#0000
    • Profil
    • Derniers messages
    • Tribu
#322
  0
tem como colocar mais de dois spawns pros ratos nascerem aleatoriamente em um ou em outro, através de um script?
Lemigre
1503613620000
    • Lemigre#0000
    • Profil
    • Derniers messages
    • Tribu
#323
[Modéré par Excasr, raison : removido]

Dernière modification le 1503614040000
Gamedroit
« Citoyen »
1503617700000
    • Gamedroit#3347
    • Profil
    • Derniers messages
    • Tribu
#324
  0
Travonrodfer a dit :
tem como colocar mais de dois spawns pros ratos nascerem aleatoriamente em um ou em outro, através de um script?

Aqui https://pastebin.com/8REkKdH3 :V
Anne
« Citoyen »
1503698820000
    • Anne#2415
    • Profil
    • Derniers messages
    • Tribu
#325
  1
.. meu deus ajudem por favor
Travonrodfer
« Censeur »
1503760560000
    • Travonrodfer#0000
    • Profil
    • Derniers messages
    • Tribu
#326
  0
como eu faço pra mover todos os jogadores da sala com o comando tfm.exec.movePlayer
quando eu uso nil ou all da erro dizendo que não pode ser nil
Fly
« Citoyen »
1503761460000
    • Fly#8215
    • Profil
    • Derniers messages
    • Tribu
#327
  0
Travonrodfer a dit :
como eu faço pra mover todos os jogadores da sala com o comando tfm.exec.movePlayer
quando eu uso nil ou all da erro dizendo que não pode ser nil

Com loop for genérico

Code Lua

1
2
3
for all in pairs(tfm.get.room.playerList) do
tfm.exec.movePlayer(all, 10, 10)
end
Roose
« Citoyen »
1503764640000
    • Roose#7190
    • Profil
    • Derniers messages
    • Tribu
#328
  0
Um script no qual tem um ''bloco correndo atraz de vc'' seu objetivo e não deixar ele chegar perto de vc se ele encosta no rato a pessoa ''morre''
Travonrodfer
« Censeur »
1503766560000
    • Travonrodfer#0000
    • Profil
    • Derniers messages
    • Tribu
#329
  0
como eu adiciono uma joint no mapa? não entendi muito bem o comando tfm.exec.addJoint
Fly
« Citoyen »
1503842760000
    • Fly#8215
    • Profil
    • Derniers messages
    • Tribu
#330
  0
Uhzinhooo a dit :
Um script no qual tem um ''bloco correndo atraz de vc'' seu objetivo e não deixar ele chegar perto de vc se ele encosta no rato a pessoa ''morre''

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
local _B     = {
x = 400,
y = 200,
w = 40,
h = 40,
}
local _D = {
x = {},
y = {},
}
local _S = {}

function eventNewPlayer(name)
_S[name] = {
immortality = {time=3000,clock=os.time()}
}
end
table.foreach(tfm.get.room.playerList, eventNewPlayer)

function eventPlayerRespawn(name)
_S[name].immortality = {time=3000,clock=os.time()}
end

function update(t)
if t == 'start' then
tfm.exec.addPhysicObject(1, _B.x, _B.y, {
type = 12,
width = _B.w,
height = _B.h,
color = 0x324650,
})
elseif t == 'move' then
if #_D.x > 0 and #_D.y > 0 then
if _B.x < _D.x[1] or _B.x > _D.x[1] and _B.y < _D.y[1] or _B.y > _D.y[1] then
_B.x = (_B.x < _D.x[1] and _B.x + 10 or _B.x - 10)
_B.y = (_B.y < _D.y[1] and _B.y + 10 or _B.y - 10)
end
end
tfm.exec.addPhysicObject(1, _B.x, _B.y, {
type = 12,
width = _B.w,
height = _B.h,
color = 0x324650,
})
end
end

function eventLoop()
_D.x = {}
_D.y = {}

for k,v in next,tfm.get.room.playerList do
if not v.isDead then
table.insert(_D.x, v.x)
table.insert(_D.y, v.y)
end
if not v.isDead and _B.x + _B.w/2+25 >= v.x and _B.x - _B.w/2-25 <= v.x and _B.y + _B.h/2+25 >= v.y and _B.y - _B.h/2-25 <= v.y then
if _S[k].immortality.clock <= os.time()-_S[k].immortality.time then
tfm.exec.killPlayer(k)
end
end
end
table.sort(_D.x, function(a,b)
return (a - _B.x) > (b - _B.x)
end)
table.sort(_D.y, function(a,b)
return (a - _B.y) > (b - _B.y)
end)
update('move')

print(_D.x[1])
end

update('start')
Roose
« Citoyen »
1503846600000
    • Roose#7190
    • Profil
    • Derniers messages
    • Tribu
#331
  0
Script de Rank, tem que ter Vitorias, Derrotas, e não deve ser contado pelo score e sim pelo wins da pessoa, no final da partida ex: Eu ganhei uma partida Eu fico no rank com 1, ganhei outra fico com 2 vai subindo +1
Travonrodfer
« Censeur »
1503949620000
    • Travonrodfer#0000
    • Profil
    • Derniers messages
    • Tribu
#332
  0
Travonrodfer a dit :
como eu adiciono uma joint no mapa? não entendi muito bem o comando tfm.exec.addJoint

e nao choca ngm
Roose
« Citoyen »
1503961200000
    • Roose#7190
    • Profil
    • Derniers messages
    • Tribu
#333
  0
Script de chuva acida vou explicar como deve funcionar O mapa vai esta chovendo (já tenho o script de chuva) essa chuva quando entrar em contato com o rato o rato leva dano(Deve ter sistema de Vida)Nos mapas tem algumas coisas, no qual os ratos devem entrar la para sobreviver, da chuva acida quem ficar dentro das casas não leva dano, Obg Plz ajudem :)
Nicjubram
« Citoyen »
1504197600000
    • Nicjubram#0000
    • Profil
    • Derniers messages
#334
  0
tem nenhum script de pesca?
Rianmojang1
« Citoyen »
1504216020000
    • Rianmojang1#0000
    • Profil
    • Derniers messages
    • Tribu
#335
  0
Nicjubram a dit :
tem nenhum script de pesca?

Aqui

creditos: contistente
Salwez
« Consul »
1504293780000
    • Salwez#0000
    • Profil
    • Derniers messages
#336
  0
Apertar a barra de espaço e o rato irá virar uma bola de praia (item de shaman)
Roose
« Citoyen »
1504371540000
    • Roose#7190
    • Profil
    • Derniers messages
    • Tribu
#337
  0
Script de Perfil Tem que Ter Vitoria,Derrota A vitória não deve ser contada, pelo score do jogador.
Isayayaa
« Citoyen »
1504442460000
    • Isayayaa#3725
    • Profil
    • Derniers messages
    • Tribu
#338
  0
Tem algm d caça ao tesouro?
Leitininho
« Citoyen »
1504483560000
    • Leitininho#1006
    • Profil
    • Derniers messages
#339
  0
Quero um script que possa desenhar com partículas por favor agradeço muito!!
:D
Gamedroit
« Citoyen »
1504619760000
    • Gamedroit#3347
    • Profil
    • Derniers messages
    • Tribu
#340
  0
.................

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

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

Version 1.27