×

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
« ‹ 29 / 160 › »
Script Requests
Shamousey
« Consul »
1385870160000
    • Shamousey#0095
    • Profil
    • Derniers messages
    • Tribu
#561
  0
Splashclaweh a dit :
A script that instantly plays this youtube video

You can't play videos with modules at all.
Arber
« Citoyen »
1385896560000
    • Arber#0000
    • Profil
    • Derniers messages
    • Tribu
#562
  0
Look the instant cannons with a mouse click can be done.

Why no portals?

like with right click, blue portal, and left one, orange portal

can that be done?

a dit :

for name,player in pairs(tfm.get.room.playerList) do
system.bindMouse(name, true)
end

function eventMouse(name, x, y)
tfm.exec.addShamanObject(tfm.enum.shamanObject.cannon, x, y, 0, 0, 0, false)
end
Safwanrockz
« Censeur »
1385897340000
    • Safwanrockz#0095
    • Profil
    • Derniers messages
    • Tribu
#563
  0
Arber a dit :
Look the instant cannons with a mouse click can be done.

Why no portals?

like with right click, blue portal, and left one, orange portal

can that be done?

There is no event/function for the right mouse button.
Tailtong
« Citoyen »
1385901000000
    • Tailtong#0000
    • Profil
    • Derniers messages
    • Tribu
#564
  0
Is there a way to get the length of a table?
Safwanrockz
« Censeur »
1385901300000
    • Safwanrockz#0095
    • Profil
    • Derniers messages
    • Tribu
#565
  0
Tailtong a dit :
Is there a way to get the length of a table?

table.getn(table) or #table
Shamousey
« Consul »
1385907540000
    • Shamousey#0095
    • Profil
    • Derniers messages
    • Tribu
#566
  0
This doesn't count the amount of items in an associative table though, so I'd recommend looping through it to increment a number in this case.

a dit :
tbl={something=true,monkeys="Awesome",smelly=4}

function countTable(tbl)
local i=i
for _ in pairs(tbl) do
i=i+1
end
return i
end

 
Safwanrockz
« Censeur »
1385907840000
    • Safwanrockz#0095
    • Profil
    • Derniers messages
    • Tribu
#567
  0
Shamousey a dit :
This doesn't count the amount of items in an associative table though, so I'd recommend looping through it to increment a number in this case.

 

Oh, I now know what's an associative table; it's not used a lot anyway.
Shamousey
« Consul »
1385908560000
    • Shamousey#0095
    • Profil
    • Derniers messages
    • Tribu
#568
  0
Safwanrockz a dit :
Oh, I now know what's an associative table; it's not used a lot anyway.

They're used quite a lot in most people's scripts. tfm.get.room.playerList and tfm.get.room.objectList are associative tables as well, so you could use that function if you ever want to count how many players are in the room for example.
Barsems
1385986920000
    • Barsems#0000
    • Profil
    • Derniers messages
#569
[Modéré par Bolinboy, raison : http://www.transformice.com/forum/?s=458983&p=0]
Pmcarpan
« Citoyen »
1386062580000
    • Pmcarpan#0000
    • Profil
    • Derniers messages
    • Tribu
#570
  0
Bethdacat a dit :
It says [Welcome to Bethdacat!] when I load it. I would like one like QuickCloud except a different detailed version of it.

It would be better if you describe exactly what you want ^^'

Anyways, the corrected previous code is in the link below:
http://pastebin.com/mAVFPC70
Abdeltif
« Citoyen »
1386079560000
    • Abdeltif#0000
    • Profil
    • Derniers messages
    • Tribu
#571
  0
How to make an object spawn every 10 sc ?
Easy way please
Rigbylua
« Citoyen »
1386089460000
    • Rigbylua#0000
    • Profil
    • Derniers messages
    • Tribu
#572
  0
Abdeltif a dit :
How to make an object spawn every 10 sc ?
Easy way please

very easy

a dit :
function eventLoop(Int currentTime, Int timeRemaining)
tfm.exec.addShamanObject(Int objectId, Int xPosition, Int yPosition, Int angle, Int xSpeed, Int ySpeed, Boolean ghost)
end
Shamousey
« Consul »
1386089700000
    • Shamousey#0095
    • Profil
    • Derniers messages
    • Tribu
#573
  0
That'd spawn it every half a second, Rigbylua. You can use simple math to make it every 10 seconds, though.

a dit :
t=0
function eventLoop(time,remaining)
t=t+0.5
if t==10 then
tfm.exec.addShamanObject(0,400,200)
t=0
end
end

 
Abdeltif
« Citoyen »
1386092160000
    • Abdeltif#0000
    • Profil
    • Derniers messages
    • Tribu
#574
  0
Shamousey a dit :
That'd spawn it every half a second, Rigbylua. You can use simple math to make it every 10 seconds, though.

 

Hmm , okay I'll see , also ! Isn't the Loop every 400 ms ? not 0.5 :/
Shamousey
« Consul »
1386092400000
    • Shamousey#0095
    • Profil
    • Derniers messages
    • Tribu
#575
  0
It's every 0.5s, not 0.4s.

Documentation a dit :
eventLoop(Int currentTime, Int timeRemaining)
• This event occurs every 500 miliseconds.

 
Abdeltif
« Citoyen »
1386092400000
    • Abdeltif#0000
    • Profil
    • Derniers messages
    • Tribu
#576
  0
Shamousey a dit :
It's every 0.5s, not 0.4s.

 

okay , wow for that html <3
Juuhsig
1386193380000
    • Juuhsig#0000
    • Profil
    • Derniers messages
#577
[Modéré par Katburger, raison : Spam]
Orb
« Censeur »
1386266880000
    • Orb#0095
    • Profil
    • Derniers messages
    • Tribu
#578
  0
A script where you get respawned exactly where you died?
Shamousey
« Consul »
1386267120000
    • Shamousey#0095
    • Profil
    • Derniers messages
    • Tribu
#579
  0
Magicalorb a dit :
A script where you get respawned exactly where you died?

--Going with the idea that playerList doesn't update instantly, you co-ordinates are kept in the playerList for a very short amount of time after you die.

function eventPlayerDied(name)
tfm.exec.respawnPlayer(name)
tfm.exec.movePlayer(name,tfm.get.room.playerList[name].x,tfm.get.room.playerList[name].y)
end
Zyx
1386282360000
    • Zyx#8690
    • Profil
    • Derniers messages
#580
[Modéré par Katburger, raison : Wrong thread]
  • Forums
  • /
  • Transformice
  • /
  • Modules
  • /
  • Script Requests
« ‹ 29 / 160 › »
© Atelier801 2018

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

Version 1.27