×

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!
« ‹ 23 / 133 › »
[Lua] Peça scripts aqui!
Quinckas
« Citoyen »
1513388640000
    • Quinckas#0579
    • Profil
    • Derniers messages
    • Tribu
#441
  0
Travonrodfer a dit :
queria um script que quando rato pegasse o queijo o rato que pegou o queijo fosse teleportado pra x 0 y 0 infinitamente

Code Lua

1
2
3
4
5
6
7
8
9
10
11
p = {}
function eventPlayerGetCheese(playerName)
p[playerName] = true
end
function eventLoop()
for k in pairs(tfm.get.room.playerList) do
if p[k] then
tfm.exec.movePlayer(k,1,1,false,0,0,false)
end
end
end
Travonrodfer
« Censeur »
1513388760000
    • Travonrodfer#0000
    • Profil
    • Derniers messages
    • Tribu
#442
  0
Quinzinhojr a dit :
Code Lua

1
2
3
function eventKeyboard(playerName, key, down, x, y)

end
como se usa o "down"? tentei mas não consegui :/
exemplo: se vc clicar na tela segurando x tecla vai printar "texto"

isso é pra escolher se você quer que ative algo quando você apertar o botão ou pressionar o botão
Nos exemplos abaixo eu escolhi ativar um efeito de teleporte com os dois tipos:

Pressionando
Code Lua

1
2
3
4
5
6
7
8
9
function eventKeyboard(name, key, down, x, y)
if key == 32 then
tfm.exec.displayParticle(37, x, y, 0, 0, 0, 0, name)
end
end

for name,v in pairs(tfm.get.room.playerList) do
system.bindKeyboard(name, 32, false, true)
end


Apertando
Code Lua

1
2
3
4
5
6
7
8
9
function eventKeyboard(name, key, down, x, y)
if key == 32 then
tfm.exec.displayParticle(37, x, y, 0, 0, 0, 0, name)
end
end

for name,v in pairs(tfm.get.room.playerList) do
system.bindKeyboard(name, 32, true, true)
end
Hugotitas
« Citoyen »
1513452000000
    • Hugotitas#0000
    • Profil
    • Derniers messages
    • Tribu
#443
  0
Lobomal772 a dit :
um que permite por um totem trol ou sair balao de tudo conte parte

Acho que isso não é possível
Travonrodfer
« Censeur »
1513469880000
    • Travonrodfer#0000
    • Profil
    • Derniers messages
    • Tribu
#444
  0
tem como apertar as setas e as letras A-D e o rato não andar
Travonrodfer
« Censeur »
1513542780000
    • Travonrodfer#0000
    • Profil
    • Derniers messages
    • Tribu
#445
  0
queria q rodasse mapas de modo aleatórios por xml não por @code
+Noobcampeur
« Consul »
1513543980000
    • +Noobcampeur#0000
    • Profil
    • Derniers messages
#446
  0
Ao apertar a tecla espaço o rato irá fazer uma ação, ex: sentar, soltar beijos, facepalm, etc
Quinckas
« Citoyen »
1513547100000
    • Quinckas#0579
    • Profil
    • Derniers messages
    • Tribu
#447
  0
+Noobcampeur a dit :
Ao apertar a tecla espaço o rato irá fazer uma ação, ex: sentar, soltar beijos, facepalm, etc

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
emote = 0 -- troque 0 pelo id do emote que vc quer
--[[ ids
0 - Dançar
1 - Rir
2 - Chorar
3 - Beijar
4 - Irritado
5 - Bater palmas
6 - Dormir
7 - Facepalm
8 - Sentar
9 - Confete
10 - Bandeira
11 - Marchimelo
12 - Self
13 - Mão pra cima
14 - Hive Five
15 - Hive Five
16 - Lingua de sogra
--]]

function eventNewPlayer(playerName)
system.bindKeyboard(playerName,32,false,true)
end
for p in pairs(tfm.get.room.playerList) do
eventNewPlayer(p)
end
function eventKeyboard(playerName, key, down, x, y)
tfm.exec.playEmote(playerName,emote)
end

Travonrodfer a dit :
queria q rodasse mapas de modo aleatórios por xml não por @code

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
v = 0
xmls = { -- coloque os xmls entre as aspas simples
'',
'',
'',
'',
'',
''
}
function main()
tfm.exec.disableAfkDeath(true)
tfm.exec.newGame(xmls[math.random(#xmls)])
v = 0
for p,k in pairs(tfm.get.room.playerList) do
if not k.isDead then
v = v + 1
end
end
end
function eventLoop(currentTime, timeRemaining)
if timeRemaining <= 0 then
main()
end
end
function checkV()
if v < 1 then
main()
end
end
function eventPlayerRespawn(playerName)
v = v + 1
checkV()
end
function eventPlayerDied(playerName)
v = v - 1
checkV()
end
function eventPlayerLeft(playerName)
v = v - 1
checkV()
end
function eventPlayerWon(playerName)
v = v - 1
checkV()
end
main()

Dernière modification le 1513548360000
Gabrielaaoi
« Sénateur »
1513720560000
    • Gabrielaaoi#0000
    • Profil
    • Derniers messages
    • Tribu
#448
  0
script de ao apertar shift fazer outro jogador que eu escolher fazer alguma ação/emoção
Quinckas
« Citoyen »
1513721700000
    • Quinckas#0579
    • Profil
    • Derniers messages
    • Tribu
#449
  0
Gabrielaaoi a dit :
script de ao apertar shift fazer outro jogador que eu escolher fazer alguma ação/emoçã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
p = 'Gabrielaaoi' -- coloque seu nome aqui
emote = 0 -- troque 0 pelo id do emote que vc quer
--[[ids
0 - Dançar
1 - Rir
2 - Chorar
3 - Beijar
4 - Irritado
5 - Bater palmas
6 - Dormir
7 - Facepalm
8 - Sentar
9 - Confete
10 - Bandeira
11 - Marchimelo
12 - Self
13 - Mão pra cima
14 - Hive Five
15 - Hive Five
16 - Lingua de sogra
]]--
system.bindKeyboard(p,16,false,true)

function eventKeyboard(playerName, key, down, x, y)
ui.addPopup(0, 2, "<p align='center'>Digite o nome do jogador</p>", playerName, 296, 99, 200, true)
end

function eventPopupAnswer(popupId, playerName, answer)
tfm.exec.playEmote(answer,emote)
end
+Noobcampeur
« Consul »
1514127780000
    • +Noobcampeur#0000
    • Profil
    • Derniers messages
#450
  0
Script de fazer uma ação e o rato de outra pessoa fazer a mesma?
Bolodefchoco
« Sénateur »
1514130840000
    • Bolodefchoco#0095
    • Profil
    • Derniers messages
    • Tribu
#451
  1
+Noobcampeur a dit :
Script de fazer uma ação e o rato de outra pessoa fazer a mesma?

Code Lua

1
2
3
4
5
6
7
8
voce = "+Noobcampeur"
pessoa = "Bolodefchoco"

eventEmotePlayed = function(n, i)
if n == voce then
tfm.exec.playEmote(pessoa, i)
end
end
Xlyjc
« Citoyen »
1514211480000
    • Xlyjc#0000
    • Profil
    • Derniers messages
#452
  0
Como eu carrego os mapas atraves do lua tipo newgame , eu faco isso e volta pro cafofo
Bolodefchoco
« Sénateur »
1514214780000
    • Bolodefchoco#0095
    • Profil
    • Derniers messages
    • Tribu
#453
  1
Xlyjc a dit :
Como eu carrego os mapas atraves do lua tipo newgame , eu faco isso e volta pro cafofo

Não entendi muito bem sua pergunta, mas para carregar um mapa usando tfm.exec.newGame você pode fazer de algumas maneiras:

tfm.exec.newGame(12345) -- Sem aspas, só o número
tfm.exec.newGame("@12345") -- Com aspas e @
tfm.exec.newGame("#1") -- Com aspas e #, seguido do número da categoria, por exemplo: 4 = shaman, 5 = arte, 6 = mecanismo, 7 racing..

Pra colocar vários mapas e fazê-los rodar você pode fazer o seguinte:

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
mapas = {0, 1, 2, 3} -- Coloque aqui o código (sem "@") dos mapas, separados por vírgulas

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

newMap = false
eventNewGame = function()
newMap = true
end

id_mapa = 1
eventLoop = function(current, elapsed)
-- Se o tempo acabar ou (se o tempo for maior que 3.5s e não tiver nenhum jogador vivo), novo mapa
if current <= 1000 or (current >= 3500 and vivos() < 1) then
if newMap then
id_mapa = id_mapa + 1
-- Reinicia a rotação se já foram todos os mapas
if id_mapa > #mapas then
id_mapa = 1
end
newMap = false
end

tfm.exec.newGame(mapas[id_mapa])
-- Se tiver só 2 ratos no mapa ou o shaman morreu, então o tempo vai ser 20 ou menos
elseif vivos() < 3 or not shaman() then
tfm.exec.setGameTime(20, false)
end
end

tfm.exec.disableAutoNewGame() -- Impossibilita do mapa acabar quando o tempo acabar, caso o eventLoop não seja suficiente naquele milissegundo
tfm.exec.newGame(id_mapa)

@Edit
Caso você queira apenas um mapa, basta
Code Lua

1
2
tfm.exec.disableAutoNewGame()
tfm.exec.newGame(12312) -- Código do mapa sem "@"

Dernière modification le 1514223300000
Asuna_yuuuuuuki
« Consul »
1514249100000
    • Asuna_yuuuuuuki#0834
    • Profil
    • Derniers messages
#454
  0
Alguém aqui tem o script de Verdade ou Desafio?
Grata desde já.
Bolodefchoco
« Sénateur »
1514250960000
    • Bolodefchoco#0095
    • Profil
    • Derniers messages
    • Tribu
#455
  1
Dengodengos a dit :
Alguém aqui tem o script de Verdade ou Desafio?
Grata desde já.

[Script] Truth or Dare por Mousetat
Asuna_yuuuuuuki
« Consul »
1514254740000
    • Asuna_yuuuuuuki#0834
    • Profil
    • Derniers messages
#456
  0
Bolodefchoco a dit :
Dengodengos a dit :
Alguém aqui tem o script de Verdade ou Desafio?
Grata desde já.

[Script] Truth or Dare por Mousetat

Obrigada
Coelhow
« Citoyen »
1514494380000
    • Coelhow#8638
    • Profil
    • Derniers messages
#457
  0
Algum script De pesca
Bolodefchoco
« Sénateur »
1514499600000
    • Bolodefchoco#0095
    • Profil
    • Derniers messages
    • Tribu
#458
  1
Yukimin_hake a dit :
Algum script De pesca

Code Lua

1
2
3
4
5
6
7
8
9
10
11
eventNewGame = function()
for k,v in next,tfm.get.room.playerList do
system.bindKeyboard(k, 3, true, true)
end
end

eventKeyboard = function(n, k)
tfm.exec.playEmote(n, 11)
end

tfm.exec.newGame('<C><P F="0" /><Z><S><S L="235" X="24" H="59" Y="446" T="7" P="0,0,0.1,0.2,-70,0,0,0" /><S L="220" H="59" X="149" Y="336" T="7" P="0,0,0.1,0.2,-10,0,0,0" /><S L="220" X="225" H="59" Y="313" T="7" P="0,0,1,0.2,10,0,0,0" /><S L="220" H="59" X="73" Y="368" T="7" P="0,0,0.1,0.2,-50,0,0,0" /><S L="220" X="419" H="59" Y="384" T="7" P="0,0,1.2,0.2,-150,0,0,0" /><S L="250" H="100" X="193" Y="390" T="7" P="0,0,0.1,0.2,-180,0,0,0" /><S L="250" X="274" H="100" Y="400" T="7" P="0,0,0.1,0.2,-180,0,0,0" /><S L="377" H="93" X="611" Y="399" T="9" P="0,0,,,,0,0,0" /></S><D><P P="1,0" Y="362" T="6" X="73" /><P P="0,0" Y="410" T="6" X="352" /><P P="0,0" Y="391" T="6" X="269" /><P P="0,1" Y="282" T="6" X="168" /><P P="0,0" Y="283" T="7" X="200" /><P P="0,0" Y="328" T="8" X="61" /><DS Y="267" X="214" /></D><O /></Z></C>')
Thetrueprime
« Citoyen »
1514579100000
    • Thetrueprime#0000
    • Profil
    • Derniers messages
    • Tribu
#459
  0
um script que um objeto aparece e desaparece ._.
Bolodefchoco
« Sénateur »
1514581320000
    • Bolodefchoco#0095
    • Profil
    • Derniers messages
    • Tribu
#460
  1
Thetrueprime a dit :
um script que um objeto aparece e desaparece ._.

Code Lua

1
2
3
4
5
6
7
8
9
10
11
12
13
id = tfm.exec.addShamanObject(1, 400, 200)

local time = 0
eventLoop = function()
if time >= 0 then
time = time + .5
end

if time == 3 then
tfm.exec.removeObject(id)
time = -1
end
end

espero que goste

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

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

Version 1.27