×

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
« ‹ 11 / 33 › »
Lua Snippets
Beachking
« Citoyen »
1380457080000
    • Beachking#0000
    • Profil
    • Derniers messages
    • Tribu
#201
  0
a dit :
ui.addTextArea(TYPE,'<font color="#COLOR"><font size="SIZE"><b><i>TEXT</i></b></font>',player,Xpos,Ypos,width,length,0xCOLORINSIDE,0xCOLORBORDER,ALPHA)

-- You can use HTML to modify the Text.
-- Alpha = Above 1 will make the box disappear but the text will still show. To activate alpha start below 0.
-- <i> is Itallics
-- <b> is Bold
-- Type = Yes or No/Close Button/Comment(0/1/2/3)


 
Mete
« Citoyen »
1380457200000
    • Mete#9214
    • Profil
    • Derniers messages
    • Tribu
#202
  0
can you give me ffa codes?
Abdeltif
« Citoyen »
1380457440000
    • Abdeltif#0000
    • Profil
    • Derniers messages
    • Tribu
#203
  0
a dit :
for tfm.get.room.playerList[name].isShaman do
tfm.exec.setVampirePlayer(playerName)
end

[•] Init Error : transformice.lua:274: [string "transformice.lua"]:1: '=' or 'in' expected
What's rong huehuehue
Papero
« Citoyen »
1380457560000
    • Papero#9240
    • Profil
    • Derniers messages
    • Tribu
#204
  0
Abdeltif a dit :
[•] Init Error : transformice.lua:274: [string "transformice.lua"]:1: '=' or 'in' expected
What's rong huehuehue

for p,_ in pairs (tfm.get.room.playerList) do
if tfm.get.room.playerList

.isShaman then
tfm.exec.setVampirePlayer(p)
end
end

-- this should work.

Mapsych
« Citoyen »
1380460260000
    • Mapsych#0000
    • Profil
    • Derniers messages
    • Tribu
#205
  0
i want print and chatmessage working for all :p
Zutto
« Citoyen »
1380462840000
    • Zutto#4451
    • Profil
    • Derniers messages
    • Tribu
#206
  0
I have a problem D=

function eventChatCommand(playerName,command)
end
elseif command=="sham" then
tfm.exec.setShaman(name)
end
elseif command=="meep" then
tfm.exec.giveMeep(name)
end
elseif command=="mort" then
tfm.exec.killPlayer(name)
end
elseif command=="victory" then
tfm.exec.giveCheese(name)
end
tfm.exec.playerVictory(name)
end
elseif command=="comandos" then
ui.addPopup(2,0,"<font size='15' color='#C0C0D8'>Estos son los comandos actuales: <b>!sham</b> - Te transformas en chamán. <b>!meep</b> - Te da el meep. <b>!mort</b> - Mueres. <b>!victory</b> - Ganas la partida.</font></p>",targetPlayer,270,200,300)
end
end

That don't work D=
Mikuhl
« Citoyen »
1380462960000
    • Mikuhl#3311
    • Profil
    • Derniers messages
    • Tribu
#207
  0
Aritxy a dit :

function eventChatCommand(playerName,command)
end

For one, your ending the function right away.
Zutto
« Citoyen »
1380463200000
    • Zutto#4451
    • Profil
    • Derniers messages
    • Tribu
#208
  0
Jaackster a dit :
For one, your ending the function right away.

function eventChatCommand(playerName,command)
end
elseif command=="sham" then
tfm.exec.setShaman(name)
elseif command=="meep" then
tfm.exec.giveMeep(name)
elseif command=="mort" then
tfm.exec.killPlayer(name)
elseif command=="victory" then
tfm.exec.giveCheese(name)
tfm.exec.playerVictory(name)
elseif command=="comandos" then
ui.addPopup(2,0,"<font size='15' color='#C0C0D8'>Estos son los comandos actuales: <b>!sham</b> - Te transformas en chamán. <b>!meep</b> - Te da el meep. <b>!mort</b> - Mueres. <b>!victory</b> - Ganas la partida.</font></p>",targetPlayer,270,200,300)
end
end

--

[•] Init Error : transformice.lua:274: [string "transformice.lua"]:4: '' expected
Xxninjazxx
« Citoyen »
1380463200000
    • Xxninjazxx#0000
    • Profil
    • Derniers messages
#209
  0
remove the end after the function eventChatcommand

use an if instead of elseif for the first command
Zutto
« Citoyen »
1380463740000
    • Zutto#4451
    • Profil
    • Derniers messages
    • Tribu
#210
  0
Xxninjazxx a dit :
remove the end after the function eventChatcommand

use an if instead of elseif for the first command

function eventChatCommand(playerName,command)
elseif command=="sham" then
tfm.exec.setShaman(name)
if command=="meep" then
tfm.exec.giveMeep(name)
if command=="mort" then
tfm.exec.killPlayer(name)
if command=="victory" then
tfm.exec.giveCheese(name)
tfm.exec.playerVictory(name)
if command=="comandos" then
ui.addPopup(2,0,"<font size='15' color='#C0C0D8'>Estos son los comandos actuales: <b>!sham</b> - Te transformas en chamán. <b>!meep</b> - Te da el meep. <b>!mort</b> - Mueres. <b>!victory</b> - Ganas la partida.</font></p>",targetPlayer,270,200,300)
end
end


-- don't work D=
Antoinemaalo
« Citoyen »
1380463740000
    • Antoinemaalo#0000
    • Profil
    • Derniers messages
#211
  0
All conditions except the first one should start with elseif, whereas the first one should be a simple "if".
Antoinemaalo
« Citoyen »
1380463860000
    • Antoinemaalo#0000
    • Profil
    • Derniers messages
#212
  0
You also seem to have a slight error, playerName is supplied, and not name.
Xxninjazxx
« Citoyen »
1380463860000
    • Xxninjazxx#0000
    • Profil
    • Derniers messages
#213
  0
NO IT SHOULD BE IF FOR THE FIRST ONE AND ELSEIF FOR THE REST
Zutto
« Citoyen »
1380463860000
    • Zutto#4451
    • Profil
    • Derniers messages
    • Tribu
#214
  0
Xxninjazxx a dit :
NO IT SHOULD BE IF FOR THE FIRST ONE AND ELSEIF FOR THE REST

Oh sorry xd
Orb
« Censeur »
1380464640000
    • Orb#0095
    • Profil
    • Derniers messages
    • Tribu
#215
  0
How can I make a !clear (removing all the objects) code? i've tried

a dit :
elseif cmd == "clear" then
function eventLoop()
tfm.exec.removeObject(19) -- for cannons so far
end

but it doesnt work.
Hophipmice
« Citoyen »
1380464760000
    • Hophipmice#0000
    • Profil
    • Derniers messages
    • Tribu
#216
  0
Magicalorb a dit :
How can I make a !clear (removing all the objects) code? i've tried
but it doesnt work.

double end, or if it's not your last command, leave it with no ends and then add double ends after your last command.
Baasbase
« Citoyen »
1380464760000
    • Baasbase#0095
    • Profil
    • Derniers messages
#217
  0
Magicalorb a dit :
How can I make a !clear (removing all the objects) code? i've tried
but it doesnt work.

Baasbase a dit :

elseif cmd == "clear" then
remove = {}
for i,o in pairs(tfm.get.room.objectList) do
table.insert(remove, i)
end
for _,n in pairs(remove) do
tfm.exec.removeObject(n)
end
end
Orb
« Censeur »
1380464880000
    • Orb#0095
    • Profil
    • Derniers messages
    • Tribu
#218
  0
Baasbase a dit :
codee

[•] Init Error : transformice.lua:274: [string "transformice.lua"]:93: 'end' expected (to close 'function' at line 51)
Tailtong
« Citoyen »
1380464880000
    • Tailtong#0000
    • Profil
    • Derniers messages
    • Tribu
#219
  0
put another end
Unicorm
« Citoyen »
1380467940000
    • Unicorm#0000
    • Profil
    • Derniers messages
    • Tribu
#220
  0
Could you add something to spawn balls everywhere every few milliseconds, maybe? -3-
  • Forums
  • /
  • Transformice
  • /
  • Modules
  • /
  • Lua Snippets
« ‹ 11 / 33 › »
© Atelier801 2018

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

Version 1.27