×

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
« ‹ 17 / 33 › »
Lua Snippets
Zyx
« Censeur »
1380580200000
    • Zyx#8690
    • Profil
    • Derniers messages
#321
  0
Epicshawty a dit :
Look below. Mort only works for Kiokasama and playeronly works for players (and Kiokasama). Other players cant do !mort.
Enjoy your admin command.

Okay.

E: Clearly I'm stupid since it always shows errors when I validate that.
Xxninjazxx
« Citoyen »
1380583800000
    • Xxninjazxx#0000
    • Profil
    • Derniers messages
#322
  0
I tried to make a minigame and now it won't work

*cries*
Epicshawty
« Citoyen »
1380585720000
    • Epicshawty#0000
    • Profil
    • Derniers messages
    • Tribu
#323
  0
Xxninjazxx a dit :
I tried to make a minigame and now it won't work

*cries*

Post the code in paste.moepl.eu or somethin
Jtojto
« Citoyen »
1380592620000
    • Jtojto#0000
    • Profil
    • Derniers messages
    • Tribu
#324
  0
Trying to make a script that respawns a dead mouse upon a cannon being spawned, at the moment I have this.
a dit :
function table.random(t, associative)
associative = associative or false
if associative then
local t2 = {}
for k in pairs(t) do
t2[#t2 + 1] = k
end
return t[table.random(t2)]
else
return t[math.random(1,#t)]
end
end

function eventSummoningEnd(name,id)
if id==17 or id==18 or id==19 or id==20 then
tfm.exec.respawnPlayer(table.random(tfm.get.room.playerList,true).playerName)
end
end

However, that just picks from any mouse, including the ones that are alive, so it doesn't actually do what I want it to do. I'm assuming it is just something I'm missing, so hopefully someone can help. <:
Shamousey
« Consul »
1380593520000
    • Shamousey#0095
    • Profil
    • Derniers messages
    • Tribu
#325
  0
Jtojto a dit :
However, that just picks from any mouse, including the ones that are alive, so it doesn't actually do what I want it to do. I'm assuming it is just something I'm missing, so hopefully someone can help. &lt;:

Just make a table of people that are alive, and pick from that.

a dit :
function eventSummoningEnd(name,id)
if id==17 or id==18 or id==19 or id==20 then
local dead={}
for name,player in pairs(tfm.get.room.playerList) do
if player.isDead then
table.insert(dead,name)
end
end
if #dead>=1 then
tfm.exec.respawnPlayer(table.random(dead))
end
end
end

 
Funkieee
« Citoyen »
1380596220000
    • Funkieee#0000
    • Profil
    • Derniers messages
    • Tribu
#326
  0
Sorry if you find a mistake in my english, I speak spanish, but how do I make a command that for example changes the color of my name if I say !color Funkieee 000FFF and turn it to blue?
Kirilkiril
« Citoyen »
1380613200000
    • Kirilkiril#0000
    • Profil
    • Derniers messages
#327
  0
a dit :

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

Can someone change the script,insted of flying with space,can u make it with Arrow Up?
Shamousey
« Consul »
1380614760000
    • Shamousey#0095
    • Profil
    • Derniers messages
    • Tribu
#328
  0
Funkieee a dit :
Sorry if you find a mistake in my english, I speak spanish, but how do I make a command that for example changes the color of my name if I say !color Funkieee 000FFF and turn it to blue?

function eventChatCommand(name,command)
local arg={}
for argument in args:gmatch("[^%s]+") do
table.insert(arg,argument)
end
if arg[1]=="color" then
tfm.exec.setNameColor(arg[2],tonumber(arg[3],16))
end
end

Kirilkiril a dit :
Can someone change the script,insted of flying with space,can u make it with Arrow Up?

Change the 32 to 38.
Sennesandin
« Citoyen »
1380647160000
    • Sennesandin#0000
    • Profil
    • Derniers messages
#329
  0
a dit :
local sonObjeDususZamani = 0
function eventLoop()
if os.difftime(os.time(), sonObjeDususZamani) >= 3000 then
tfm.exec.addShamanObject(40,400,0)
sonObjeDususZamani = os.time()
end
end

I want to fall in 3 different places so it will be like?
Mikuhl
« Citoyen »
1380655740000
    • Mikuhl#3311
    • Profil
    • Derniers messages
    • Tribu
#330
  0
Funkieee a dit :
Sorry if you find a mistake in my english, I speak spanish, but how do I make a command that for example changes the color of my name if I say !color Funkieee 000FFF and turn it to blue?

That is in the OP, 'Advanced Command'
Zyx
« Censeur »
1380661860000
    • Zyx#8690
    • Profil
    • Derniers messages
#331
  0
So Bengal gave me this snippet.

if 1<2 then print("Hello, welcome to Dreamer of Dreams!") endif 1 <2 then print ( "Type in !commands for a list of commands." )end

What's wrong with it? It always says errors and I'm trying to remove anything I can find, but nothing works.
Bengalstar
« Citoyen »
1380661980000
    • Bengalstar#0000
    • Profil
    • Derniers messages
#332
  0
Swirlfire a dit :
So Bengal gave me this snippet.

if 1&lt;2 then print("Hello, welcome to Dreamer of Dreams!") endif 1 &lt;2 then print ( "Type in !commands for a list of commands." )end

What's wrong with it? It always says errors and I'm trying to remove anything I can find, but nothing works.

hmm
maybe this might work

if 1>2 then print("Hello, welcome to Dreamer of Dreams!")
end
if 1 <2 then print ( "Type in !commands for a list of commands." )
end
Zyx
« Censeur »
1380662100000
    • Zyx#8690
    • Profil
    • Derniers messages
#333
  0
Bengalstar a dit :
hmm
maybe this might work

if 1&gt;2 then print("Hello, welcome to Dreamer of Dreams!")
end
if 1 &lt;2 then print ( "Type in !commands for a list of commands." )
end

Okay it worked thank youuu
Bengalstar
« Citoyen »
1380662220000
    • Bengalstar#0000
    • Profil
    • Derniers messages
#334
  0
Swirlfire a dit :
Okay it worked thank youuu

any time

also that code I gave you I was trying to explain you were supposed to enter the ends
Xdmanuxd
« Citoyen »
1380663120000
    • Xdmanuxd#0000
    • Profil
    • Derniers messages
    • Tribu
#335
  0
a dit :
tfm.exec.newGame ('<C><P F="0" L="1200" /><Z><S><S L="25" H="26" X="386" Y="362" T="1" P="0,0,0.2,0.2,-30,0,0,0" /><S L="49" H="21" X="55" Y="165" T="2" P="0,0,0,1.2,0,0,0,0" /><S L="31" H="85" X="439" Y="357" T="5" P="0,0,0.3,0.2,0,0,0,0" /><S L="40" H="151" X="404" Y="324" T="6" P="0,0,0.3,0.2,0,0,0,0" /><S L="40" X="765" H="151" Y="324" T="6" P="0,0,0.3,0.2,0,0,0,0" /><S L="95" H="27" X="502" Y="386" T="5" P="0,0,0.3,0.2,0,0,0,0" /><S L="25" H="75" X="732" Y="362" T="5" P="0,0,0.3,0.2,0,0,0,0" /><S L="120" H="239" X="60" Y="280" T="6" P="0,0,0.3,0.2,0,0,0,0" /><S L="79" H="18" X="255" Y="390" T="3" P="0,0,0,9999,0,0,0,0" /><S L="20" H="19" X="1122" Y="288" T="5" P="0,0,0.3,0.2,0,0,0,0" /><S L="30" H="10" X="16" Y="156" T="5" P="0,0,0.3,0.2,0,0,0,0" /><S L="22" H="11" X="1148" Y="296" T="2" P="0,0,0,1.2,0,0,0,0" /><S L="49" H="21" X="677" Y="100" T="3" P="0,0,0,20,20,0,0,0" /><S L="40" X="99" H="10" Y="156" T="5" P="0,0,0.3,0.2,0,0,0,0" /><S L="20" X="1175" H="19" Y="288" T="5" P="0,0,0.3,0.2,0,0,0,0" /><S L="162" H="15" X="456" Y="80" T="3" P="0,0,0,9999,0,0,0,0" /><S L="35" H="21" X="554" Y="77" T="5" P="0,0,0.3,0.2,0,0,0,0" /><S L="90" H="11" X="830" Y="393" T="3" P="0,0,0,9999,0,0,0,0" /><S L="149" H="40" X="1033" Y="380" T="5" P="0,0,0.3,0.2,0,0,0,0" /><S L="80" H="108" X="1149" Y="347" T="6" P="0,0,0.3,0.2,0,0,0,0" /><S L="81" H="10" X="337" Y="83" T="5" P="0,0,0.3,0.2,0,0,0,0" /><S L="91" H="21" X="614" Y="85" T="5" P="0,0,0.3,0.2,10,0,0,0" /><S L="13" H="30" X="882" Y="94" T="6" P="0,0,0.3,0.2,0,0,0,0" /><S L="76" H="20" X="970" Y="159" T="5" P="0,0,0.3,0.2,0,0,0,0" /><S L="29" H="17" X="909" Y="160" T="3" P="0,0,0,9999,0,0,0,0" /><S L="62" H="21" X="184" Y="77" T="5" P="0,0,0.3,0.2,10,0,0,0" /><S L="81" H="21" X="336" Y="77" T="5" P="0,0,0.3,0.2,-10,0,0,0" /><S L="86" H="21" X="739" Y="108" T="5" P="0,0,0.3,0.2,0,0,0,0" /></S><D><F Y="73" X="602" /><T Y="374" X="529" /><DC Y="48" X="349" /></D><O /></Z></C>')

[•] You can't call this function [tfm.exec.newGame] more than once per 3 seconds.
Shamousey
« Consul »
1380663900000
    • Shamousey#0095
    • Profil
    • Derniers messages
    • Tribu
#336
  0
Swirlfire a dit :
endif

This isn't a valid operator.

Xdmanuxd a dit :
[•] You can't call this function [tfm.exec.newGame] more than once per 3 seconds.

What's the problem? The error/warning there tells you exactly what's going on.
Xdmanuxd
« Citoyen »
1380664020000
    • Xdmanuxd#0000
    • Profil
    • Derniers messages
    • Tribu
#337
  0
I have two XML but I only recorded the first and the other does not pass, which is the rotation script?

@ googleTranslater
Zyx
« Censeur »
1380664440000
    • Zyx#8690
    • Profil
    • Derniers messages
#338
  0
Could I save this snippet here?

for name,player in pairs(tfm.get.room.playerList) do
tfm.exec.setShaman(name)
tfm.exec.setVampirePlayer(name)
end
Epicshawty
« Citoyen »
1380668520000
    • Epicshawty#0000
    • Profil
    • Derniers messages
    • Tribu
#339
  0
Swirlfire a dit :
Could I save this snippet here?

for name,player in pairs(tfm.get.room.playerList) do
tfm.exec.setShaman(name)
tfm.exec.setVampirePlayer(name)
end

If you didn't notice, that snippet was in the OP.
Jtojto
« Citoyen »
1380674940000
    • Jtojto#0000
    • Profil
    • Derniers messages
    • Tribu
#340
  0
a dit :
function table.random(t, associative)
associative = associative or false
if associative then
local t2 = {}
for k in pairs(t) do
t2[#t2 + 1] = k
end
return t[table.random(t2)]
else
return t[math.random(1,#t)]
end
end

function eventSummoningEnd(name,id)
if id==17 or id==18 or id==19 or id==20 then
print("Starting respawn process")
local dead={}
for name,player in pairs(tfm.get.room.playerList) do
if player.isDead then
table.insert(dead,name)
elseif player.isAlive then
table.remove(dead,name)
end
end
local alive={}
for name,player in pairs(tfm.get.room.playerList) do
if player.isAlive then
if not player.isShaman then
table.insert(alive,name)
end
elseif player.isDead then
if not player.isShaman then
table.remove(alive,name)
end
end
end
if #dead>=1 and #alive>=2 then
tfm.exec.respawnPlayer(table.random(dead))
end
end
end

function eventPlayerRespawn(name)
tfm.exec.setNameColor(name,0x800000)
end

function eventLoop(time,remaining)
if remaining<=1000 then
print("Starting new round")
tfm.exec.disableAutoShaman(true)
tfm.exec.disableAutoNewGame(true)
tfm.exec.newGame(0)
for name,player in pairs(tfm.get.room.playerList) do
tfm.exec.setNameColor(name,0xC2C2DA)
end
tfm.exec.setShaman(table.random(tfm.get.room.playerList,true).playerName)
end
for name,player in pairs(tfm.get.room.playerList) do
if player.isShaman then
tfm.exec.setUIShamanName(name)
end
end
end

function eventPlayerDied()
for name,player in pairs(tfm.get.room.playerList) do
if player.isShaman then
tfm.exec.respawnPlayer(name)
end
end
end

I want to get this script to start a new round upon the number of mice that are alive being less than or equal to 1, however I was getting a few different errors depending on how I changed that portion. I just got rid of it for now and never saved it, so this is the script that doesn't have my attempt to get it to work included.
  • Forums
  • /
  • Transformice
  • /
  • Modules
  • /
  • Lua Snippets
« ‹ 17 / 33 › »
© Atelier801 2018

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

Version 1.27