×

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
  • /
  • Lua Snippets
« ‹ 4 / 33 › »
Lua Snippets
Mar4e
1380298620000
    • Mar4e#7318
    • Profil
    • Derniers messages
    • Tribu
#61
[Modéré par Ramenfrog, raison : Spam.]
Bumblet
« Citoyen »
1380305760000
    • Bumblet#0000
    • Profil
    • Derniers messages
#62
  0
I dig this
Moesappel
« Citoyen »
1380306300000
    • Moesappel#0000
    • Profil
    • Derniers messages
    • Tribu
#63
  0
How to add .!mort ?
Shamousey
« Consul »
1380306300000
    • Shamousey#0095
    • Profil
    • Derniers messages
    • Tribu
#64
  0
a dit :
function eventChatCommand(name,command)
if command=="mort" then
tfm.exec.killPlayer(name)
end
end

 
Tailtong
« Citoyen »
1380306900000
    • Tailtong#0000
    • Profil
    • Derniers messages
    • Tribu
#65
  0
a simpler way is just
a dit :

function eventChatCommand(name, mort)
tfm.exec.killPlayer(name)
end

Taleyes
« Citoyen »
1380306900000
    • Taleyes#0000
    • Profil
    • Derniers messages
#66
  0
is it normal that the skills from a shaman don't work with the code to make everyone shaman?
Mymicemy
« Citoyen »
1380306900000
    • Mymicemy#0000
    • Profil
    • Derniers messages
    • Tribu
#67
  0
EDIT: Nevermind
Typenick
« Citoyen »
1380306900000
    • Typenick#0000
    • Profil
    • Derniers messages
    • Tribu
#68
  0
Tailtong a dit :
a simpler way is just

Won't it just kill anyone who uses any command?

As a side note, has anyone got an elegant way to split strings in lua? It'd be nice to have that in default library but duh.
Tailtong
« Citoyen »
1380307020000
    • Tailtong#0000
    • Profil
    • Derniers messages
    • Tribu
#69
  0
well i had !vamp and !death in my tribe house and !vamp didn't kill, if that's what you're asking
Shamousey
« Consul »
1380307200000
    • Shamousey#0095
    • Profil
    • Derniers messages
    • Tribu
#70
  0
Taleyes a dit :
is it normal that the skills from a shaman don't work with the code to make everyone shaman?

Yes, people made a shaman through tfm.exec.setShaman() aren't meant to have skills. This was Tig's idea for solving the fact we wanted a way to disable skills.

Tailtong a dit :
well i had !vamp and !death in my tribe house and !vamp didn't kill, if that's what you're asking

And what was the code you had for that? Typenick is right that it'd kill anyone that uses any command.
Mymicemy
« Citoyen »
1380307560000
    • Mymicemy#0000
    • Profil
    • Derniers messages
    • Tribu
#71
  0
What's wrong with this? (I want write !fly and fly)

a dit :
function eventChatCommand(name, fly)
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 then
tfm.exec.movePlayer(name,0,0,true,0,-50,false)
end
end

Help
Tailtong
« Citoyen »
1380307680000
    • Tailtong#0000
    • Profil
    • Derniers messages
    • Tribu
#72
  0
Shamousey a dit :
And what was the code you had for that? Typenick is right that it'd kill anyone that uses any command.

function eventChatCommand(name, death)
tfm.exec.killPlayer(name)
end
function eventChatCommand(name, vamp)
tfm.exec.setVampirePlayer(name)
end
Taleyes
« Citoyen »
1380308040000
    • Taleyes#0000
    • Profil
    • Derniers messages
#73
  0
Shamousey a dit :
Yes, people made a shaman through tfm.exec.setShaman() aren't meant to have skills. This was Tig's idea for solving the fact we wanted a way to disable skills..

is there a way to let them have their skills or not?
Mikuhl
« Citoyen »
1380308040000
    • Mikuhl#3311
    • Profil
    • Derniers messages
    • Tribu
#74
  0
Taleyes a dit :
is there a way to let them have their skills or not?

nope
Typenick
« Citoyen »
1380308340000
    • Typenick#0000
    • Profil
    • Derniers messages
    • Tribu
#75
  0
a dit :
function split(arg)
out = {}
for i in string.gmatch(arg, "%S+") do
table.insert(out, i)
end
return out
end

First (0th, actually) element is nil for some reason but it works fine otherwise.
Xxninjazxx
« Citoyen »
1380309360000
    • Xxninjazxx#0000
    • Profil
    • Derniers messages
#76
  0
Here's a command to make people shaman if they type !sham (You can change it though)

a dit :
function eventChatCommand(name,command)
if command=="sham" then --Change the area in quotes if you want to use a different command
tfm.exec.setShaman(name)
end
end
Mymicemy
« Citoyen »
1380309720000
    • Mymicemy#0000
    • Profil
    • Derniers messages
    • Tribu
#77
  0
Xxninjazxx a dit :
Here's a command to make people shaman if they type !sham (You can change it though)

function eventChatCommand(name, sham)
tfm.exec.setShaman(name)
end

And this is simpler
Xxninjazxx
« Citoyen »
1380309840000
    • Xxninjazxx#0000
    • Profil
    • Derniers messages
#78
  0
How come you can't do two commands at the same time (Or how would you do it)

And can someone show a simple example where this is used?


http://i.imgur.com/WhwuMGR.png
Bumblet
« Citoyen »
1380312300000
    • Bumblet#0000
    • Profil
    • Derniers messages
#79
  0
Not sure
Shamousey
« Consul »
1380313200000
    • Shamousey#0095
    • Profil
    • Derniers messages
    • Tribu
#80
  0
Mymicemy a dit :
function eventChatCommand(name, sham)
tfm.exec.setShaman(name)
end

And this is simpler

That would work, but wouldn't allow for multiple commands.

Xxninjazxx a dit :
How come you can't do two commands at the same time (Or how would you do it)

You can. If you were trying something like this, it wouldn't work.

Multiple Commands a dit :
function eventChatCommand(name,command)
if command=="first" then
print("This is one command.")
elseif command=="second" then
print("This is another command.")
end
end

Hopefully this example will help you out.

Xxninjazxx a dit :
And can someone show a simple example where this is used?

Check the OP of the Module API thread, there's a flying example that uses keyboards.
  • Forums
  • /
  • Transformice
  • /
  • Modules
  • /
  • Lua Snippets
« ‹ 4 / 33 › »
© Atelier801 2018

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

Version 1.27