×

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
  • /
  • Modules
  • /
  • [Aide] Demandes de codes et d'explications
« ‹ 25 / 70 › »
[Aide] Demandes de codes et d'explications
Rectop
« Citoyen »
1396011000000
    • Rectop#0000
    • Profil
    • Derniers messages
    • Tribu
#481
  0
Nathaan a dit :
Désolé du double post mais c'est pour avoir une réponse (si je modifie personne ne verra).

J'aimerai savoir si c'est possible d'afficher toutes les variables en faisant !varlist.

Tu peux toujours entrer les variables manuellement à la suite, tu veux que ça se fasse sans toutes les rentrer?
Nathaan
« Citoyen »
1396029660000
    • Nathaan#0000
    • Profil
    • Derniers messages
    • Tribu
#482
  0
Je veux que ça fasse tout seul, mais après je peux quand même faire manuellement...
Podoko
« Citoyen »
1396038240000
    • Podoko#0000
    • Profil
    • Derniers messages
    • Tribu
#483
  0
À part mettre toutes tes variables dans une grosse table, je vois pas.
Louimice
« Citoyen »
1396279800000
    • Louimice#0000
    • Profil
    • Derniers messages
    • Tribu
#484
  0
Salut, j'ai un petit proclème...

J'avais fait un module (avec l'aide d'Aaaaahera) qui fonctionnait bien, jusqu'à ce qu'on rajoute la commande !fly...

Depuis qu'on l'a rajouté, les autres commandes ne fonctionnent plus, il y a uniquement le !fly et le !fly off !

Dans la version du drapeau anglais, c'est cette version, celle où il n'y a que ces deux commandes qui fonctionnent.

Dans la version du drapeau espagnol, on a essayé de réparer, mais ça a empiré et plus rien ne fonctionne --'

J'espère que vous pourrez m'aider, vu que je débute en lua je vois pas trop ce qui va pas...

Et encore désolé pour les & et autre, je sais pas si ça a un impact sur le fonctionnement du module ?
version = "[Bêta]"

version = "[1.01]"
players={}

ui.addTextArea (2,"Commandes Version : "..version.."", name, 5, 382, 260, 20, 0x000001, 0xffffff, 0.f, true)


function eventNewPlayer(pseudo)
ui.addPopup(1, 0, "Salut"..pseudo..", bienvenue dans la maison de tribu de la Milice ! Marque !commandes dans le chat pour en savoir plus ! Module Développé par Louimice et Aaaaahera", pseudo, 150, 75, 500)
end
function eventChatCommand(name,command)
if command == "fromage" then
tfm.exec.giveCheese(name)
end
if command == "gagner" then
tfm.exec.playerVictory(name)
end
if command == "vampire" then
tfm.exec.setVampirePlayer(name)
tfm.exec.setNameColor (name,0x93241A)
end
if command == "pseudo rouge" then
tfm.exec.setNameColor (name,0xf00000)
end
if command == "pseudo bleu" then
tfm.exec.setNameColor (name,0x0A23FF)
end
if command == "pseudo jaune" then
tfm.exec.setNameColor (name,0xE0FF33)
end
if command == "pseudo noir" then
tfm.exec.setNameColor (name,0x010101)
end
if command == "pseudo vert" then
tfm.exec.setNameColor (name,0x2EFA51)
end
if command == "pseudo rose" then
tfm.exec.setNameColor (name,0xFF2EF3)
end
if command == "mort" then
tfm.exec.killPlayer (name)
end
if command == "neige" then
tfm.exec.snow (60, 10)
end
if command == "glacer" then
tfm.exec.addShamanObject(54,tfm.get.room.playerList[name].x,tfm.get.room.playerList[name].y)
tfm.exec.killPlayer(name)
end
if command == "fireworks" then
tfm.exec.displayParticle (0, math.random(0,800), math.random(0,400), 1.0, 1.0, 1.0, 1.0, nil)
tfm.exec.displayParticle (1, math.random(0,800), math.random(0,400), 1.0, 1.0, 1.0, 1.0, nil)
tfm.exec.displayParticle (2, math.random(0,800), math.random(0,400), 1.0, 1.0, 1.0, 1.0, nil)
tfm.exec.displayParticle (4, math.random(0,800), math.random(0,400), 1.0, 1.0, 1.0, 1.0, nil)
tfm.exec.displayParticle (11, math.random(0,800), math.random(0,400), 1.0, 1.0, 1.0, 1.0, nil)
tfm.exec.displayParticle (13, math.random(0,800), math.random(0,400), 1.0, 1.0, 1.0, 1.0, nil)
tfm.exec.displayParticle (1, math.random(0,800), math.random(0,400), 1.0, 1.0, 1.0, 1.0, nil)
tfm.exec.displayParticle (2, math.random(0,800), math.random(0,400), 1.0, 1.0, 1.0, 1.0, nil)
tfm.exec.displayParticle (4, math.random(0,800), math.random(0,400), 1.0, 1.0, 1.0, 1.0, nil)
tfm.exec.displayParticle(math.random(0, 30), math.random(200,600), math.random(100,290),0,0,0,0,nil)
end
if command == "bombe" then
tfm.exec.addShamanObject(23, math.random(0, 800), math.random(0, 400), 0, 0, 0, false)
end
if command == "commandes" then
ui.addTextArea (0,"<font size='17'>Voici toutes les commandes que vous pouvez effectuer sur cette version :</font><br><br> !Fromage <br> !gagner <br> !vampire <br> !pseudo rouge, bleu, jaune vert ou noir <br> !mort <br> !neige <br> !glacer <br> !fireworks <br> !bombe <br> !chamane <br> !fermer commandes (pour fermer cette fenêtre)", name, 5, 27, 355, 468, 0x010101, 0x010101, 0.5, true)
end
if command == "fermer commandes" then
ui.removeTextArea (0, name)
end
if command == "chamane" then
tfm.exec.setShaman (name)
end
end

function eventNewPlayer(name)
tfm.exec.bindKeyboard(name,32,true,true)
end

for name,player in pairs(tfm.get.room.playerList) do
eventNewPlayer(name)
end

function eventKeyboard(name,key,down,x,y)
if key==32 and players[name] then
tfm.exec.movePlayer(name,0,0,true,0,-50,false)
end
end

function eventChatCommand(name,msg)
if msg=="fly" then
players[name]=true
elseif msg=="fly off" then
players[name]=false
end
end


tfm.exec.disableAfkDeath(true)

version = "[1.01]"

ui.addTextArea (2,"Commandes Version : "..version..", name, 5, 382, 260, 20, 0x000001, 0xffffff, 0.f, true)

function eventNewPlayer(playerName)
ui.addPopup(1,0,"Salut"..pseudo..", bienvenue dans la maison de tribu de la Milice ! Marque !commandes dans le chat pour en savoir plus ! Module Développé par Louimice et Aaaaahera" playerName, 150, 75, 500,true)
bind() -- pour fermer :)
end
function eventChatCommand(name,command)
if command == "fromage" then
tfm.exec.giveCheese(name)
end
if command == "gagner" then
tfm.exec.playerVictory(name)
end
if command =="fly" then
players[name]=true
end
if command =="fly off" then
players[name]=false
end
if command == "vampire" then
tfm.exec.setVampirePlayer(name)
tfm.exec.setNameColor (name,0x93241A)
end
if command == "pseudo rouge" then
tfm.exec.setNameColor (name,0xf00000)
end
if command == "pseudo bleu" then
tfm.exec.setNameColor (name,0x0A23FF)
end
if command == "pseudo jaune" then
tfm.exec.setNameColor (name,0xE0FF33)
end
if command == "pseudo noir" then
tfm.exec.setNameColor (name,0x010101)
end
if command == "pseudo vert" then
tfm.exec.setNameColor (name,0x2EFA51)
end
if command == "pseudo rose" then
tfm.exec.setNameColor (name,0xFF2EF3)
end
if command == "mort" then
tfm.exec.killPlayer (name)
end
if command == "neige" then
tfm.exec.snow (60, 10)
end
if command == "glacer" then
tfm.exec.addShamanObject(54,tfm.get.room.playerList[name].x,tfm.get.room.playerList[name].y)
tfm.exec.killPlayer(name)
end
if command == "fireworks" then
tfm.exec.displayParticle (0, math.random(0,800), math.random(0,400), 1.0, 1.0, 1.0, 1.0, nil)
tfm.exec.displayParticle (1, math.random(0,800), math.random(0,400), 1.0, 1.0, 1.0, 1.0, nil)
tfm.exec.displayParticle (2, math.random(0,800), math.random(0,400), 1.0, 1.0, 1.0, 1.0, nil)
tfm.exec.displayParticle (4, math.random(0,800), math.random(0,400), 1.0, 1.0, 1.0, 1.0, nil)
tfm.exec.displayParticle (11, math.random(0,800), math.random(0,400), 1.0, 1.0, 1.0, 1.0, nil)
tfm.exec.displayParticle (13, math.random(0,800), math.random(0,400), 1.0, 1.0, 1.0, 1.0, nil)
tfm.exec.displayParticle (1, math.random(0,800), math.random(0,400), 1.0, 1.0, 1.0, 1.0, nil)
tfm.exec.displayParticle (2, math.random(0,800), math.random(0,400), 1.0, 1.0, 1.0, 1.0, nil)
tfm.exec.displayParticle (4, math.random(0,800), math.random(0,400), 1.0, 1.0, 1.0, 1.0, nil)
tfm.exec.displayParticle(math.random(0, 30), math.random(200,600), math.random(100,290),0,0,0,0,nil)
end
if command == "bombe" then
tfm.exec.addShamanObject(23, math.random(0, 800), math.random(0, 400), 0, 0, 0, false)
end
if command == "commandes" then
ui.addTextArea (0,"<font size='17'>Voici toutes les commandes que vous pouvez effectuer sur cette version :</font><br><br> !Fromage <br> !gagner <br> !vampire <br> !pseudo rouge, bleu, jaune vert ou noir <br> !mort <br> !neige <br> !glacer <br> !fireworks <br> !bombe <br> !chamane <br> !fermer commandes (pour fermer cette fenêtre)", name, 5, 27, 355, 468, 0x010101, 0x010101, 0.5, true)
end
if command == "fermer commandes" then
ui.removeTextArea (0, name)
end
if command == "chamane" then
tfm.exec.setShaman (name)
end
end

function eventNewPlayer(name)
tfm.exec.bindKeyboard(name,32,true,true)
end

for name,player in pairs(tfm.get.room.playerList) do
eventNewPlayer(name)
end

function eventKeyboard(name,key,down,x,y)
if key==32 and players[name] then
tfm.exec.movePlayer(name,0,0,true,0,-50,false)
end
end

Thallium
« Censeur »
1396283760000
    • Thallium#0095
    • Profil
    • Derniers messages
    • Tribu
#485
  0
Le code n'est pas parfait non plus mais toutes tes commandes fonctionnent. Je t'ai juste modifié deux trois points car tu te répétais parfois (notamment avec la fonction "function eventNewPlayer(name)").
Sinon, pour que toutes tes commandes puissent fonctionner il fallait mettre le "fly" et "fly off" dans un seul et unique "function eventChatCommand(name,command)" (il ne faut pas répéter deux fonctions, sinon ça peut créer des erreurs comme tu as eu). Tu ne devrais plus avoir de problèmes.
version = "[Bêta]"

version = "[1.01]"
players={}

ui.addTextArea (2,"Commandes Version : "..version, name, 5, 382, 260, 20, 0x000001, 0xffffff, 0.f, true)

function eventNewPlayer(pseudo)
ui.addPopup(1, 0, "Salut "..pseudo..", bienvenue dans la maison de tribu de la Milice ! Marque !commandes dans le chat pour en savoir plus ! Module Développé par Louimice et Aaaaahera", pseudo, 150, 75, 500)
tfm.exec.bindKeyboard(pseudo,32,true,true)
end

function eventChatCommand(name,command)
if command == "fromage" then
tfm.exec.giveCheese(name)
elseif command=="fly" then
players[name]=true
elseif command=="fly off" then
players[name]=false
elseif command == "gagner" then
tfm.exec.playerVictory(name)
elseif command == "vampire" then
tfm.exec.setVampirePlayer(name)
tfm.exec.setNameColor (name,0x93241A)
elseif command == "pseudo rouge" then
tfm.exec.setNameColor (name,0xf00000)
elseif command == "pseudo bleu" then
tfm.exec.setNameColor (name,0x0A23FF)
elseif command == "pseudo jaune" then
tfm.exec.setNameColor (name,0xE0FF33)
elseif command == "pseudo noir" then
tfm.exec.setNameColor (name,0x010101)
elseif command == "pseudo vert" then
tfm.exec.setNameColor (name,0x2EFA51)
elseif command == "pseudo rose" then
tfm.exec.setNameColor (name,0xFF2EF3)
elseif command == "mort" then
tfm.exec.killPlayer (name)
elseif command == "neige" then
tfm.exec.snow (60, 10)
elseif command == "glacer" then
tfm.exec.addShamanObject(54,tfm.get.room.playerList[name].x,tfm.get.room.playerList[name].y)
tfm.exec.killPlayer(name)
elseif command == "fireworks" then
tfm.exec.displayParticle (0, math.random(0,800), math.random(0,400), 1.0, 1.0, 1.0, 1.0, nil)
tfm.exec.displayParticle (1, math.random(0,800), math.random(0,400), 1.0, 1.0, 1.0, 1.0, nil)
tfm.exec.displayParticle (2, math.random(0,800), math.random(0,400), 1.0, 1.0, 1.0, 1.0, nil)
tfm.exec.displayParticle (4, math.random(0,800), math.random(0,400), 1.0, 1.0, 1.0, 1.0, nil)
tfm.exec.displayParticle (11, math.random(0,800), math.random(0,400), 1.0, 1.0, 1.0, 1.0, nil)
tfm.exec.displayParticle (13, math.random(0,800), math.random(0,400), 1.0, 1.0, 1.0, 1.0, nil)
tfm.exec.displayParticle (1, math.random(0,800), math.random(0,400), 1.0, 1.0, 1.0, 1.0, nil)
tfm.exec.displayParticle (2, math.random(0,800), math.random(0,400), 1.0, 1.0, 1.0, 1.0, nil)
tfm.exec.displayParticle (4, math.random(0,800), math.random(0,400), 1.0, 1.0, 1.0, 1.0, nil)
tfm.exec.displayParticle(math.random(0, 30), math.random(200,600), math.random(100,290),0,0,0,0,nil)
elseif command == "bombe" then
tfm.exec.addShamanObject(23, math.random(0, 800), math.random(0, 400), 0, 0, 0, false)
elseif command == "commandes" then
ui.addTextArea (0,"<font size='17'>Voici toutes les commandes que vous pouvez effectuer sur cette version :</font><br><br> !Fromage <br> !gagner <br> !vampire <br> !pseudo rouge, bleu, jaune vert ou noir <br> !mort <br> !neige <br> !glacer <br> !fireworks <br> !bombe <br> !chamane <br> !fermer commandes (pour fermer cette fenêtre)", name, 5, 27, 355, 468, 0x010101, 0x010101, 0.5, true)
elseif command == "fermer commandes" then
ui.removeTextArea (0, name)
elseif command == "chamane" then
tfm.exec.setShaman (name)
end
end

function eventKeyboard(name,key,down,x,y)
if key==32 and players[name] then
tfm.exec.movePlayer(name,0,0,true,0,-50,false)
end
end

for name,player in pairs(tfm.get.room.playerList) do
eventNewPlayer(name)
end
Louimice
« Citoyen »
1396286820000
    • Louimice#0000
    • Profil
    • Derniers messages
    • Tribu
#486
  0
Oh, merci ! :D

Tout fonctionne ^^

Par contre, ça correspond à quoi "player in pairs" stp ? Cette partie là c'est Aaaaahera qui l'a faite. Mais vu qu'il s'est fait bannir, je sais pas pourquoi d'ailleurs, elle peut pas trop m'expliquer :S
Thallium
« Censeur »
1396293600000
    • Thallium#0095
    • Profil
    • Derniers messages
    • Tribu
#487
  0
a dit :
for name,player in pairs(tfm.get.room.playerList) do
eventNewPlayer(name)
end

Ca veut dire que pour chaque pseudo qui se trouve dans la liste des joueurs du salon (tfm.get.room.playerList) le code va exécuter "eventNewPlayer(name)".
Cette fonction fait référence à celle du début du code :
a dit :
function eventNewPlayer(pseudo)
ui.addPopup(1, 0, "Salut "..pseudo..", bienvenue dans la maison de tribu de la Milice ! Marque !commandes dans le chat pour en savoir plus ! Module Développé par Louimice et Aaaaahera", pseudo, 150, 75, 500)
tfm.exec.bindKeyboard(pseudo,32,true,true)
end
Louimice
« Citoyen »
1396351560000
    • Louimice#0000
    • Profil
    • Derniers messages
    • Tribu
#488
  0
Donc, à chaque fois que quelqu'un rentre dans le salon, ça affiche ça pour tout le monde ?

Par contre, pour le "elseif command" à la place du "if command", on avait déjà fait ça, mais je crois que quand il y a trop de commandes ça fonctionne plus...

J'aurais besoin de quelqu'un pour m'expliquer certains trucs en jeu :3
Thallium
« Censeur »
1396385640000
    • Thallium#0095
    • Profil
    • Derniers messages
    • Tribu
#489
  0
a dit :
for name,player in pairs(tfm.get.room.playerList) do
eventNewPlayer(name)
end

Avec ce morceau de code, quand tu lanceras ton module (et QUE quand tu le lanceras) tous les joueurs du salon seront touchés par son contenu. Donc ils auront un addPopup qui va s'afficher à leur écran et la fonction tfm.exec.bindKeyboard prendra effet.
a dit :

function eventNewPlayer(pseudo)
ui.addPopup(1, 0, "Salut "..pseudo..", bienvenue dans la maison de tribu de la Milice ! Marque !commandes dans le chat pour en savoir plus ! Module Développé par Louimice et Aaaaahera", pseudo, 150, 75, 500)
tfm.exec.bindKeyboard(pseudo,32,true,true)
end

Cette fonction en revanche s'activera (lorsque ce n'est pas par le code ci-dessus) lorsqu'un joueur entrera dans le salon. Et seulement pour CE joueur qui vient d'entrer dans ta maison de tribu la Popup et la fonction s'activeront. Pas pour les autres.
Louimice
« Citoyen »
1396436580000
    • Louimice#0000
    • Profil
    • Derniers messages
    • Tribu
#490
  0
Encore merci ^^ j'aurais d'autres questions, mais je vais écrire tout le topic à moi tout seul :p

a dit :
Edit

Voilà, comme prévu, j'ai une autre question, et c'est pas la dernière ! ^^'

J'aimerais comprendre comment faire pour remplacer les commandes '!commandes', '!meep' ou autre par une simple pression de touche...

J'ai fait ça, pour voir si ça fonctionnait, mais ça marche pas :

a dit :
function eventKeyboard (Name, keyCode, down, xPlayerPosition, yPlayerPosition)
if(keyCode == 67) then
tfm.exec.setShaman (Name)

end
end

Comment ça se fait ? (le 67 correspond à la touche C)
Nathaan
« Citoyen »
1396605540000
    • Nathaan#0000
    • Profil
    • Derniers messages
    • Tribu
#491
  0
Vus savez comment vérifier si le joueur porte un objet dans "yeux" ?

Louimice, tu n'as pas fais "bindKeyboard", ça ne marchera pas !

edit : j'ai réussi
Elyesou
« Citoyen »
1396792920000
    • Elyesou#0000
    • Profil
    • Derniers messages
    • Tribu
#492
  0
Y'a un blem dans ce code ?
function eventLoop(ct,tr)
tfm.exec.displayParticle (25, math.random(0,800),math.random(0,400), 1.0, 1.0, 1.0, 1.0, nil)
tfm.exec.displayParticle (25, math.random(0,800),math.random(0,400), 1.0, 1.0, 1.0, 1.0, nil)
tfm.exec.displayParticle (25, math.random(0,800),math.random(0,400), 1.0, 1.0, 1.0, 1.0, nil)
tfm.exec.displayParticle (25, math.random(0,800),math.random(0,400), 1.0, 1.0, 1.0, 1.0, nil)
tfm.exec.displayParticle (25, math.random(0,800),math.random(0,400), 1.0, 1.0, 1.0, 1.0, nil)
tfm.exec.displayParticle (25, math.random(0,800),math.random(0,400), 1.0, 1.0, 1.0, 1.0, nil)
tfm.exec.displayParticle (25, math.random(0,800),math.random(0,400), 1.0, 1.0, 1.0, 1.0, nil)
tfm.exec.displayParticle (25, math.random(0,800),math.random(0,400), 1.0, 1.0, 1.0, 1.0, nil)
tfm.exec.displayParticle (25, math.random(0,800),math.random(0,400), 1.0, 1.0, 1.0, 1.0, nil)
tfm.exec.displayParticle (25, math.random(0,800),math.random(0,400), 1.0, 1.0, 1.0, 1.0, nil)
tfm.exec.displayParticle (25, math.random(0,800),math.random(0,400), 1.0, 1.0, 1.0, 1.0, nil)
tfm.exec.displayParticle (25, math.random(0,800),math.random(0,400), 1.0, 1.0, 1.0, 1.0, nil)
tfm.exec.displayParticle (25, math.random(0,800),math.random(0,400), 1.0, 1.0, 1.0, 1.0, nil)
tfm.exec.displayParticle (25, math.random(0,800),math.random(0,400), 1.0, 1.0, 1.0, 1.0, nil)
tfm.exec.displayParticle (25, math.random(0,800),math.random(0,400), 1.0, 1.0, 1.0, 1.0, nil)
tfm.exec.displayParticle (25, math.random(0,800),math.random(0,400), 1.0, 1.0, 1.0, 1.0, nil)
tfm.exec.displayParticle (25, math.random(0,800),math.random(0,400), 1.0, 1.0, 1.0, 1.0, nil)
tfm.exec.displayParticle (25, math.random(0,800),math.random(0,400), 1.0, 1.0, 1.0, 1.0, nil)
tfm.exec.displayParticle (25, math.random(0,800),math.random(0,400), 1.0, 1.0, 1.0, 1.0, nil)
tfm.exec.displayParticle (25, math.random(0,800),math.random(0,400), 1.0, 1.0, 1.0, 1.0, nil)
tfm.exec.displayParticle (25, math.random(0,800),math.random(0,400), 1.0, 1.0, 1.0, 1.0, nil)
tfm.exec.displayParticle (25, math.random(0,800),math.random(0,400), 1.0, 1.0, 1.0, 1.0, nil)
tfm.exec.displayParticle (25, math.random(0,800),math.random(0,400), 1.0, 1.0, 1.0, 1.0, nil)
tfm.exec.displayParticle (25, math.random(0,800),math.random(0,400), 1.0, 1.0, 1.0, 1.0, nil)
tfm.exec.displayParticle (25, math.random(0,800),math.random(0,400), 1.0, 1.0, 1.0, 1.0, nil)
tfm.exec.displayParticle (25, math.random(0,800),math.random(0,400), 1.0, 1.0, 1.0, 1.0, nil)
tfm.exec.displayParticle (25, math.random(0,800),math.random(0,400), 1.0, 1.0, 1.0, 1.0, nil)
tfm.exec.displayParticle (25, math.random(0,800),math.random(0,400), 1.0, 1.0, 1.0, 1.0, nil)
N = 999999999999999
End
Rectop
« Citoyen »
1396794360000
    • Rectop#0000
    • Profil
    • Derniers messages
    • Tribu
#493
  0
Je ne sais pas ce que tu veux faire avec, mais enlève la majuscule à End pour éviter une erreur.
Podoko
« Citoyen »
1396797780000
    • Podoko#0000
    • Profil
    • Derniers messages
    • Tribu
#494
  0
C'est probablement la majuscule de 'end' qui fait buguer comme le dit Rectop.
Mais en plus comme tu écris 1,2,3,4... 28 fois la même ligne, tu devrais faire un for pour économiser de la place et rendre tout ce plus lisible.
a dit :
for k=0, 27 do
tfm.exec.displayParticle (25, math.random(0,800),math.random(0,400), 1.0, 1.0, 1.0, 1.0, nil)
end

 
Louimice
« Citoyen »
1396888920000
    • Louimice#0000
    • Profil
    • Derniers messages
    • Tribu
#495
  0
Nathaan a dit :
Vus savez comment vérifier si le joueur porte un objet dans "yeux" ?

Louimice, tu n'as pas fais "bindKeyboard", ça ne marchera pas !

edit : j'ai réussi

BindKeyboard, c'est une fonction ?

Pour le !fly, on ne l'a pas utilisé. C'était function eventKeyboard.

Pourquoi ce code ne peut pas fonctionner ?

a dit :

function eventKeyboard (Name, keyCode, down, xPlayerPosition, yPlayerPosition)
if(keyCode == 67) then
tfm.exec.setShaman (Name)

end
end
Deathmatic
« Citoyen »
1396892760000
    • Deathmatic#0000
    • Profil
    • Derniers messages
#496
  0
Louimice a dit :
BindKeyboard, c'est une fonction ?

Le minimum serait d'aller consulter la documentation (en anglais : Topic-451587 et Topic-543696 en français) avant de poser des questions pareilles.

Louimice a dit :
Pour le !fly, on ne l'a pas utilisé. C'était function eventKeyboard.

Dans le domaine de l'API de Transformice, il y a deux catégories de fonctions : les évents, et les fonctions qui provoquent une action du jeu. Si eventKeyboard() est un événement, bindKeyboard() est une fonction, qui, comme le précise la documentation (j'insiste, lire la doc' est primordial avant de demander quoi que ce soit !), permet de détecter l'appui sur une touche par un joueur.
Souritio
« Citoyen »
1397701860000
    • Souritio#0000
    • Profil
    • Derniers messages
    • Tribu
#497
  0
disable sa veut dire desactivé loui ._.
Taciturnite
« Citoyen »
1397826420000
    • Taciturnite#0000
    • Profil
    • Derniers messages
    • Tribu
#498
  0
Salut !
J'ai besoin d'informations sur la création d'un module mais c'est long à expliquer, alors si quelqu'un qui s'y connait bien en lua peut se connecter ig et me chuchoter je lui en serais très reconnaissant !

Merci d'avance.
Poipou
« Citoyen »
1398436440000
    • Poipou#0000
    • Profil
    • Derniers messages
    • Tribu
#499
  0
Coucou comment on utilise la commande removeObject please ? ^^
Podoko
« Citoyen »
1398462420000
    • Podoko#0000
    • Profil
    • Derniers messages
    • Tribu
#500
  0
T'as juste à passer l'id de l'objet en argument.
Tu peux trouver cet id dans l'argument "other", (other.id) au moment ou l'objet termine d'être invoqué (function eventSummoningEnd) ou dans la liste des objets du salon (tfm.get.room.objectList)

Exemple a dit :

function eventSummoningEnd ( name, type, x, y, a, xS, yS, other )
if type == 1 then -- (si l'objet est une petite caisse)
tfm.exec.removeObject ( other.id )
end
end

(Au passage, c'est une bonne chose que ce topic soit épinglé)
  • Forums
  • /
  • Transformice
  • /
  • Modules
  • /
  • [Aide] Demandes de codes et d'explications
« ‹ 25 / 70 › »
© Atelier801 2018

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

Version 1.27