×

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
  • /
  • Guia Module + Tópico de Dúvidas
« ‹ 37 / 55 › »
Guia Module + Tópico de Dúvidas
+Thogabriel
« Citoyen »
1388266080000
    • +Thogabriel#0000
    • Profil
    • Derniers messages
    • Tribu
#721
  0
n existe particula 39 .-.
Topic-540065
Byenamo
« Citoyen »
1388266200000
    • Byenamo#0000
    • Profil
    • Derniers messages
    • Tribu
#722
  0
Onde ta o erro buaaa :c


function bind(btype, keynum)
if (btype == [[all]]) then
for str,num in pairs(tfm.get.room.playerList) do
tfm.exec.bindKeyboard(str, keynum, true, true)
end
elseif (btype ~= [[all]]) then
tfm.exec.bindKeyboard(btype, keynum, true, true)
elseif (btype ~= [[all]]) then
tfm.exec.bindKeyboard(btype, keynum, true, true)
elseif (btype ~= [[all]]) then
tfm.exec.bindKeyboard(btype, keynum, true, true)
end
end

bind([[all]], 32);
bind([[all]], 9);
bind([[all]], 77);
bind([[all]], 78);

function eventKeyboard(target, key, hold, x, y)
if (key == 32) then
tfm.exec.movePlayer(target, nil, nil, true, 0, -30, true)
end
if (key == 9) then
tfm.exec.movePlayer(target, nil, nil, true, 0, -30, true)
tfm.exec.displayParticle(29, x, y, 0, 0, 0, 0, nil)
end

if (key == 77) then
tfm.exec.movePlayer(targetrue,nil,nil,true,50,0,false)
end

if (key == 78) then
tfm.exec.movePlayer(targetrue,nil,nil,true,-50,0,false)
end
end
Brenower
« Censeur »
1388270820000
    • Brenower#0000
    • Profil
    • Derniers messages
    • Tribu
#723
  0
Byenamo a dit :
Onde ta o erro buaaa :c


function bind(btype, keynum)
if (btype == [[all]]) then
for str,num in pairs(tfm.get.room.playerList) do
tfm.exec.bindKeyboard(str, keynum, true, true)
end
elseif (btype ~= [[all]]) then
tfm.exec.bindKeyboard(btype, keynum, true, true)
elseif (btype ~= [[all]]) then
tfm.exec.bindKeyboard(btype, keynum, true, true)
elseif (btype ~= [[all]]) then
tfm.exec.bindKeyboard(btype, keynum, true, true)
end
end

bind([[all]], 32);
bind([[all]], 9);
bind([[all]], 77);
bind([[all]], 78);

function eventKeyboard(target, key, hold, x, y)
if (key == 32) then
tfm.exec.movePlayer(target, nil, nil, true, 0, -30, true)
end
if (key == 9) then
tfm.exec.movePlayer(target, nil, nil, true, 0, -30, true)
tfm.exec.displayParticle(29, x, y, 0, 0, 0, 0, nil)
end

if (key == 77) then
tfm.exec.movePlayer(targetrue,nil,nil,true,50,0,false)
end

if (key == 78) then
tfm.exec.movePlayer(targetrue,nil,nil,true,-50,0,false)
end
end

Para que o targetrue se o argumento é target?
Byenamo
« Citoyen »
1388270940000
    • Byenamo#0000
    • Profil
    • Derniers messages
    • Tribu
#724
  0
Brenower a dit :
Para que o targetrue se o argumento é target?

Troquei obrigado!
Lucasmribe
« Citoyen »
1388313840000
    • Lucasmribe#0000
    • Profil
    • Derniers messages
    • Tribu
#725
  0
como crio novas function's e como usalos? =P
Brenower
« Censeur »
1388321280000
    • Brenower#0000
    • Profil
    • Derniers messages
    • Tribu
#726
  0
Lucasmribe a dit :
como crio novas function's e como usalos? =P

Primeire crie o nome da function, exemplo:
a dit :

function tfm.exec.print

Adicione os argumentos se necessario:
a dit :

function tfm.exec.print(msg)
end

Faça as funções dela:
a dit :

function tfm.exec.print(msg)
print(msg)
end

Execute ela quando quiser, exemplo:
a dit :

function eventNewGame()
tfm.exec.print("<R>Raii")
end

^-^
Laagaadoo
« Citoyen »
1388321400000
    • Laagaadoo#0000
    • Profil
    • Derniers messages
    • Tribu
#727
  0
Lucasmribe a dit :
como crio novas function's e como usalos? =P

Vamos supor que você vá ter que dar o queijo e levar o rato para toca muitas vezes no script e ainda queira que mande uma mensagem para você pelo meio de print(), você faz o seguinte:

a dit :

--Dar queijo e toca e enviar uma mensagem para você
function QueijoTocaPrint(player)
tfm.exec.giveCheese(player)
tfm.exec.playerVictory(player)
print(player.." ganhou o queijo e entrou na toca!")
end

Os argumentos você quem decide, ali em player pode ser playerName, p, pl entre outros, você pode melhorar suas próprias funções para que fiquem perfeitas, para usar esse exemplo:
a dit :

function eventChatCommand(playerName, cmd)
if(cmd == "toca") then
QueijoTocaPrint(playerName)
end
end

Lembre-se que no exemplo que eu dei o argumento player equivale ao nome do player.
Squalleze
« Citoyen »
1388321400000
    • Squalleze#0000
    • Profil
    • Derniers messages
    • Tribu
#728
  0
Brenower a dit :
Primeire crie o nome da function, exemplo:
Adicione os argumentos se necessario:

Faça as funções dela:

Execute ela quando quiser, exemplo:


^-^

Brenower --' isso é muito simples tente passar uma coisa mais complexa -'
Brenower
« Censeur »
1388321520000
    • Brenower#0000
    • Profil
    • Derniers messages
    • Tribu
#729
  0
Squalleze a dit :
Brenower --' isso é muito simples tente passar uma coisa mais complexa -'

Foi do simples que eu aprendi.

To nada V
Num sou a senhor :P
Squalleze
« Citoyen »
1388321640000
    • Squalleze#0000
    • Profil
    • Derniers messages
    • Tribu
#730
  0
Brenower a dit :
Foi do simples que eu aprendi.

E ainda ta na mesma faixa :D
Lucasmribe
« Citoyen »
1388330220000
    • Lucasmribe#0000
    • Profil
    • Derniers messages
    • Tribu
#731
  0
Laagaadoo a dit :
Vamos supor que você vá ter que dar o queijo e levar o rato para toca muitas vezes no script e ainda queira que mande uma mensagem para você pelo meio de print(), você faz o seguinte:
Os argumentos você quem decide, ali em player pode ser playerName, p, pl entre outros, você pode melhorar suas próprias funções para que fiquem perfeitas, para usar esse exemplo:


Lembre-se que no exemplo que eu dei o argumento player equivale ao nome do player.

Obrigado, mas é possivel adicionar outros argumentos nele? tipo.. ai vc colocou "(player)" pode add mais coisa? tipo (player, y, x, massege, emote)? se sim qal a ordem? ou n tem?
+Thogabriel
« Citoyen »
1388330220000
    • +Thogabriel#0000
    • Profil
    • Derniers messages
    • Tribu
#732
  0
Lucasmribe a dit :
Obrigado, mas é possivel adicionar outros argumentos nele? tipo.. ai vc colocou "(player)" pode add mais coisa? tipo (player, y, x, massege, emote)? se sim qal a ordem? ou n tem?

isso ai tem cada coisa em seu luga

tfm.exec.emotePlayer(.......)

acho que é assim
Brenower
« Censeur »
1388330460000
    • Brenower#0000
    • Profil
    • Derniers messages
    • Tribu
#733
  0
Lucasmribe a dit :
Obrigado, mas é possivel adicionar outros argumentos nele? tipo.. ai vc colocou "(player)" pode add mais coisa? tipo (player, y, x, massege, emote)? se sim qal a ordem? ou n tem?

Em qualquer ordem.
tipo function tfm.exec.namb(y,x,player,emote,massege)
Lucasmribe
« Citoyen »
1388331120000
    • Lucasmribe#0000
    • Profil
    • Derniers messages
    • Tribu
#734
  0
Brenower a dit :
Em qualquer ordem.
tipo function tfm.exec.namb(y,x,player,emote,massege)

ele não funda =/

a dit :
function namb (y,x,player,emote,massege)
tfm.exec.killPlayer(player)
tfm.exec.explosion(x, y, 111, 200, true)
end

.
Brenower
« Censeur »
1388331240000
    • Brenower#0000
    • Profil
    • Derniers messages
    • Tribu
#735
  0
Lucasmribe a dit :
ele não funda =/


.

Cade o nome da function?
E como tu pegou a x e y do player?
Lucasmribe
« Citoyen »
1388331240000
    • Lucasmribe#0000
    • Profil
    • Derniers messages
    • Tribu
#736
  0
Brenower a dit :
Cade o nome da function?
E como tu pegou a x e y do player?

coloquei o nome..., como pega o x e o y? e.e
Laagaadoo
« Citoyen »
1388346060000
    • Laagaadoo#0000
    • Profil
    • Derniers messages
    • Tribu
#737
  0
Não coloque espaço entre o nome da function e os argumentos, lembre-se que sempre o x vem primeiro do y (isso não tem diferença nos argumentos porém assim fica muito mais fácil). Pra pegar x e y:

a dit :

local x = tfm.get.room.playerList[player].x
local y = tfm.get.room.playerList[player].y

E lembre-se de usar a função corretamente.
Lucasmribe
« Citoyen »
1388400720000
    • Lucasmribe#0000
    • Profil
    • Derniers messages
    • Tribu
#738
  0
Laagaadoo a dit :
Não coloque espaço entre o nome da function e os argumentos, lembre-se que sempre o x vem primeiro do y (isso não tem diferença nos argumentos porém assim fica muito mais fácil). Pra pegar x e y:
E lembre-se de usar a função corretamente.

Obrigado =D Entao é pra isso que serve o local... Humm pode colocar ele antes do fonction? ou n? tipo:

a dit :

local x = tfm.get.room.playerList[player].x
local y = tfm.get.room.playerList[player].y
function sha.noob(x,y)
--continuação--

----------

pq não presisa pegar os "argumentos" do player e da msg como nos seus exemplos acima? .-.


---------------------------------

pra que serve o down do function eventKeyboard(pl, key, down, x,y)?
Brenower
« Censeur »
1388404560000
    • Brenower#0000
    • Profil
    • Derniers messages
    • Tribu
#739
  0
Lucasmribe a dit :
Obrigado =D Entao é pra isso que serve o local... Humm pode colocar ele antes do fonction? ou n? tipo:
----------

pq não presisa pegar os "argumentos" do player e da msg como nos seus exemplos acima? .-.


---------------------------------

pra que serve o down do function eventKeyboard(pl, key, down, x,y)?

Coloque ele na function.
--
Como assim?
Você só pega eles se for necessario.
--
Para verificar se o player está segurando a tecla.
Laagaadoo
« Citoyen »
1388410320000
    • Laagaadoo#0000
    • Profil
    • Derniers messages
    • Tribu
#740
  0
Lucasmribe a dit :
Obrigado =D Entao é pra isso que serve o local... Humm pode colocar ele antes do fonction? ou n? tipo:
----------

pq não presisa pegar os "argumentos" do player e da msg como nos seus exemplos acima? .-.


---------------------------------

pra que serve o down do function eventKeyboard(pl, key, down, x,y)?

O local é para definir uma variável local que só vai ser usada em um determinado local. Você vai usar ele para a função QueijoTocaPrint, por isso tem que ser dentro da função. Não precisa disso porque você iria usar assim:

a dit :

function eventNewPlayer(playerName)
QueijoTocaPrint(playerName)
end

O argumento player do QueijoTocaPrint seria o nome do jogador.
  • Forums
  • /
  • Transformice
  • /
  • Archives
  • /
  • Seção Editor de Mapas e Modules
  • /
  • Guia Module + Tópico de Dúvidas
« ‹ 37 / 55 › »
© Atelier801 2018

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

Version 1.27