×

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
  • /
  • Module API FAQ
« ‹ 10 / 38 › »
Module API FAQ
Abdeltif
« Citoyen »
1378568400000
    • Abdeltif#0000
    • Profil
    • Derniers messages
    • Tribu
#181
  0
How to tigger a team using tfm.exec.giveCheese
and tfm.exec.playerVictory ?

Also eventPlayerdied(playerName) for a hole team
Fxie
« Citoyen »
1378569180000
    • Fxie#0000
    • Profil
    • Derniers messages
    • Tribu
#182
  0
for i,name in ipairs(teams[1]) do
tfm.exec.giveCheese(name)
tfm.exec.giveVictory(name)
end

for i,name in ipairs(teams[2]) do
tfm.exec.killPlayer(name,x,y)
end

That's pretty obvious if you learned anything from my last post. If not, I suggest you do, because others will not be able to write your code for you in the long run. Learn from what I'm giving you, don't just keep asking for more.
Abdeltif
« Citoyen »
1378569300000
    • Abdeltif#0000
    • Profil
    • Derniers messages
    • Tribu
#183
  0
Fxie a dit :

That's pretty obvious if you learned anything from my last post. If not, I suggest you do, because others will not be able to write your code for you in the long run. Learn from what I'm giving you, don't just keep asking for more.

I did , but i want to be sure that what i typed is right .
Epicshawty
« Citoyen »
1378594560000
    • Epicshawty#0000
    • Profil
    • Derniers messages
    • Tribu
#184
  0
Fxie a dit :
function eventPlayerDied()
> local winner
> for name,player in pairs(tfm.get.room.playerList) do
> > if not player.isDead then
> > > if not winner then
> > > > winner=name
> > > else
> > > > return
> > > > end
> > > end
> > end
> tfm.exec.chatMessage(winner.." is the last person standing!")
> end

basically abort the function (return) if there are two people alive (another winner after one has been found), if there is only one winner then their name is set and yo ucan use it for whatever.

so is that one player or 2 players remaining
confuzzled
Fxie
« Citoyen »
1378595700000
    • Fxie#0000
    • Profil
    • Derniers messages
    • Tribu
#185
  0
Fxie a dit :
abort the function if there are two people alive

In other words, if there's more than one (it won't bother checking for more if there's two because what's the point?) then it does nothing. If there is only one alive, they win.

The "last person standing!" should be a dead giveaway to that.
Epicshawty
« Citoyen »
1378613580000
    • Epicshawty#0000
    • Profil
    • Derniers messages
    • Tribu
#186
  0
Fxie a dit :
In other words, if there's more than one (it won't bother checking for more if there's two because what's the point?) then it does nothing. If there is only one alive, they win.

The "last person standing!" should be a dead giveaway to that.

Thanks.
Erdemsalihh
« Citoyen »
1378738380000
    • Erdemsalihh#0000
    • Profil
    • Derniers messages
    • Tribu
#187
  0
Thanks Shamousey "-"
Enginfener
« Citoyen »
1378762320000
    • Enginfener#0000
    • Profil
    • Derniers messages
    • Tribu
#188
  0
Nice*-*
Shamousey
« Consul »
1379266680000
    • Shamousey#0095
    • Profil
    • Derniers messages
    • Tribu
#189
  0
Feel free to ask any questions in /chat Lua if you need any help, a lot of members of the Lua Team and good coders that aren't in it will be hanging around there.
Thepandaluvr
« Citoyen »
1379280360000
    • Thepandaluvr#0000
    • Profil
    • Derniers messages
    • Tribu
#190
  0
thanks you *-*
Augustinas
« Citoyen »
1379514480000
    • Augustinas#0000
    • Profil
    • Derniers messages
#191
  0
can anyone explain how to use it in tribehouse /lua then what etc...?
Mikuhl
« Citoyen »
1379535960000
    • Mikuhl#3311
    • Profil
    • Derniers messages
    • Tribu
#192
  0
Augustinas a dit :
can anyone explain how to use it in tribehouse /lua then what etc...?

/lua doesnt currently work in tribe houses, and submitting anything into the /lua box wont do anything unless your a lua team member.
Papero
« Citoyen »
1379586900000
    • Papero#9240
    • Profil
    • Derniers messages
    • Tribu
#193
  0
Jaackster a dit :
/lua doesnt currently work in tribe houses, and submitting anything into the /lua box wont do anything unless your a lua team member.

Augustinas a dit :
can anyone explain how to use it in tribehouse /lua then what etc...?

However you can run official and non-official predefined modules in tribehouses.

use /module modulenamehere
Bouncytree
« Citoyen »
1379723520000
    • Bouncytree#0000
    • Profil
    • Derniers messages
    • Tribu
#194
  0
can i join plz plz plz
Shamousey
« Consul »
1379723880000
    • Shamousey#0095
    • Profil
    • Derniers messages
    • Tribu
#195
  0
Jaackster a dit :
/lua doesnt currently work in tribe houses

"currently"

Bouncytree a dit :
can i join plz plz plz

Do you know Lua, or another programming language?
Hotaru
« Censeur »
1379784660000
    • Hotaru#0095
    • Profil
    • Derniers messages
    • Tribu
#196
  0
for setGameTime in (tfm.get.room.time) do tfm.exec.setGameTime (240) end
am i doing right? derp
Thewav
« Citoyen »
1379784780000
    • Thewav#0095
    • Profil
    • Derniers messages
    • Tribu
#197
  0
tfm.get.room.time isn't a table
Mikuhl
« Citoyen »
1379795820000
    • Mikuhl#3311
    • Profil
    • Derniers messages
    • Tribu
#198
  0
Methusalah a dit :
for setGameTime in (tfm.get.room.time) do tfm.exec.setGameTime (240) end
am i doing right? derp

If you just wanted to set the time you would do.
tfm.exec.setGameTime(240)
Baasbase
« Citoyen »
1380194040000
    • Baasbase#0095
    • Profil
    • Derniers messages
#199
  0
Topic-451587

discuss
Holomouse
« Citoyen »
1380194280000
    • Holomouse#0095
    • Profil
    • Derniers messages
    • Tribu
#200
  0
Baasbase a dit :
Topic-451587

discuss

A highly expected update! Good to know it's here. I hope they don't make us pay to use it.
  • Forums
  • /
  • Transformice
  • /
  • Archives
  • /
  • Module API FAQ
« ‹ 10 / 38 › »
© Atelier801 2018

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

Version 1.27