×

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
  • /
  • Script Requests
« ‹ 36 / 160 › »
Script Requests
Zutto
« Citoyen »
1387640400000
    • Zutto#4451
    • Profil
    • Derniers messages
    • Tribu
#701
  0
Shamousey a dit :
To excecute a function you need the parenthesis on the end for the argument parameters. Try tfm.get.room.shaman()

I did this:
a dit :


function tfm.get.room.shaman()
local shamans = {};
for name,player in pairs(tfm.get.room.playerList) do
if player.isShaman then
shamans.insert(name)
end
end
return table.unpack(shamans)
end

function eventNewGame()
tfm.exec.setUIMapName(tfm.get.room.shaman().." (The Shaman)")
end

But;
## Runtime Error : Aritxy.lua:7: attempt to call nil

Line 7º:
shamans.insert(name)

I try whit
shamans.insert(playerName)
shamans.insert(nil)
But nothing.
Safwanrockz
« Censeur »
1387640520000
    • Safwanrockz#0095
    • Profil
    • Derniers messages
    • Tribu
#702
  0
Replace it with table.insert(shamans, name).
Zutto
« Citoyen »
1387640700000
    • Zutto#4451
    • Profil
    • Derniers messages
    • Tribu
#703
  0
Safwanrockz a dit :
Replace it with table.insert(shamans, name).

~
a dit :

function tfm.get.room.shaman()
local shamans = {};
for name,player in pairs(tfm.get.room.playerList) do
if player.isShaman then
table.insert(shamans, name)
end
end
return table.unpack(shamans)
end

function eventNewGame()
tfm.exec.setUIMapName(""..tfm.get.room.shaman().." (The Shaman)")
end

Other error:
## Runtime Error : Aritxy.lua:13: attempt to call nil

Line 13º:
tfm.exec.setUIMapName(""..tfm.get.room.shaman().." (The Shaman)")

D=
Safwanrockz
« Censeur »
1387640700000
    • Safwanrockz#0095
    • Profil
    • Derniers messages
    • Tribu
#704
  0
Aritxy a dit :
~


Other error:
## Runtime Error : Aritxy.lua:13: attempt to call nil

Line 13º:
tfm.exec.setUIMapName(""..tfm.get.room.shaman().." (The Shaman)")

D=

tfm.exec.setUIMapName(tfm.get.room.shaman().." (The Shaman)")
Zutto
« Citoyen »
1387641060000
    • Zutto#4451
    • Profil
    • Derniers messages
    • Tribu
#705
  0
Safwanrockz a dit :
tfm.exec.setUIMapName(tfm.get.room.shaman().." (The Shaman)")

## Runtime Error : Aritxy.lua:12: attempt to call nil

Line 12º (Now the 13º is the 12º)
tfm.exec.setUIMapName(tfm.get.room.shaman().." (The Shaman)")
Safwanrockz
« Censeur »
1387641300000
    • Safwanrockz#0095
    • Profil
    • Derniers messages
    • Tribu
#706
  1
Aritxy a dit :
## Runtime Error : Aritxy.lua:12: attempt to call nil

Line 12º (Now the 13º is the 12º)
tfm.exec.setUIMapName(tfm.get.room.shaman().." (The Shaman)")

This seems to be working for me.
a dit :

function tfm.get.room.shaman()
for name,player in pairs(tfm.get.room.playerList) do
if player.isShaman then
shaman=name
end
end
return shaman
end

function eventNewGame()
tfm.exec.setUIMapName(tfm.get.room.shaman().." (The Shaman)")
end

 
Zutto
« Citoyen »
1387641600000
    • Zutto#4451
    • Profil
    • Derniers messages
    • Tribu
#707
  1
Safwanrockz a dit :
This seems to be working for me.
 

FINALLYYYYYYYYYY


THANKS VERY MUCH SAF AND SHA!!!!
Shamousey
« Consul »
1387642200000
    • Shamousey#0095
    • Profil
    • Derniers messages
    • Tribu
#708
  0
Safwanrockz a dit :
Oh, I was confused about these parenthesis. Why don't API functions have them? Such as tfm.get.room.currentMap? (I guess it's a table)

Exactly, that's a table and not a function. You'll notice that tfm.exec.newGame() has a parenthesis however, since that is a function.
Mymicemy
« Citoyen »
1387654500000
    • Mymicemy#0000
    • Profil
    • Derniers messages
    • Tribu
#709
  0
How to do that this
confetti a dit :
function eventLoop(ct,tr)
for i=1,20 do
tfm.exec.displayParticle(math.random(21,24), math.random(200,600), math.random(100,290),0,0,0,0,nil)
end
end

won't scroll (stay in same place) in scrolling map?
Jordy
« Consul »
1387655760000
    • Jordy#0015
    • Profil
    • Derniers messages
    • Tribu
#710
  0
Mymicemy a dit :
How to do that this won't scroll (stay in same place) in scrolling map?

Increase the X-Position value. (math.random(200,600)) - Increase 600 to 1200 or something.
Shamousey
« Consul »
1387659360000
    • Shamousey#0095
    • Profil
    • Derniers messages
    • Tribu
#711
  0
Jordynl a dit :
Increase the X-Position value. (math.random(200,600)) - Increase 600 to 1200 or something.

Or something like this to work with any map size.

a dit :
function eventLoop(ct,tr)
for i=1,20 do
tfm.exec.displayParticle(math.random(21,24),math.random(200,(tfm.get.room.xmlMapInfo.xml:match('<P[^/]+L="([^"]+)"') or 800)-200), math.random(100,290),0,0,0,0,nil)
end
end

Yteizz
« Citoyen »
1387669200000
    • Yteizz#0000
    • Profil
    • Derniers messages
#712
  0
I wanted one that has fireworks.
Issey
« Citoyen »
1387701720000
    • Issey#0000
    • Profil
    • Derniers messages
#713
  0
Yteizz a dit :
I wanted one that has fireworks.

Topic-537427
Topic-545097
Arber
« Citoyen »
1387712220000
    • Arber#0000
    • Profil
    • Derniers messages
    • Tribu
#714
  0
How do i make pages
Safwanrockz
« Censeur »
1387713780000
    • Safwanrockz#0095
    • Profil
    • Derniers messages
    • Tribu
#715
  0
Arber a dit :
How do i make pages

http://pastebin.com/1FpShWsj
Arber
« Citoyen »
1387714140000
    • Arber#0000
    • Profil
    • Derniers messages
    • Tribu
#716
  0
Safwanrockz a dit :
http://pastebin.com/1FpShWsj

It gets styck in page 2
also log in saf :(
Safwanrockz
« Censeur »
1387715280000
    • Safwanrockz#0095
    • Profil
    • Derniers messages
    • Tribu
#717
  0
Arber a dit :
It gets styck in page 2
also log in saf :(

Fixed it.
Issey
« Citoyen »
1387716300000
    • Issey#0000
    • Profil
    • Derniers messages
#718
  0
Safwanrockz a dit :
Fixed it.

das obv mine heuueu
Safwanrockz
« Censeur »
1387716300000
    • Safwanrockz#0095
    • Profil
    • Derniers messages
    • Tribu
#719
  0
Issey a dit :
das obv mine heuueu

Sssssssh.
Issey
« Citoyen »
1387718220000
    • Issey#0000
    • Profil
    • Derniers messages
#720
  0
Safwanrockz a dit :
Sssssssh.

glad to see peeps using dem snippets though
  • Forums
  • /
  • Transformice
  • /
  • Modules
  • /
  • Script Requests
« ‹ 36 / 160 › »
© Atelier801 2018

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

Version 1.27