×

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
« ‹ 19 / 33 › »
Lua Snippets
Pleasedontcopymyname
« Citoyen »
1380928860000
    • Pleasedontcopymyname#0000
    • Profil
    • Derniers messages
    • Tribu
#361
  0
a dit :
tfm.exec.disableAutoNewGame(true)
tfm.exec.disableAutoShaman(true)
players={}
toDespawn={}
maps={521833,401421,541917,541928,541936,541943,527935,559634,559644,888052,878047,885641,770600,770656,772172,891472,589736,589800,589708,900012,901062,754380,901337,901411,907870,910078,1190467,1252043,1124380,1016258,1252299,1255902,1256808,986790,1285380,1271249,1255944,1255983,1085344,1273114,1276664,1279258,1286824,1280135,1280342,1284861,1287556,1057753,1196679,1288489,1292983,1298164,1298521,1293189,1296949,1308378,1311136,1314419,1314982,1318248,1312411,1312589,1312845,1312933,1313969,1338762,1339474,1349878,1297154,644588,1351237,1354040,1354375,1362386,1283234,1370578,1306592,1360889,1362753,1408124,1407949,1407849,1343986,1408028,1441370,1443416,1389255,1427349,1450527,1424739,869836,1459902,1392993,1426457,1542824,1533474,1561467,1563534,1566991,1587241,1416119,1596270,1601580,1525751,1582146,1558167,1420943,1466487,1642575,1648013,1646094,1393097,1643446,1545219,1583484,1613092,1627981,1633374,1633277,1633251,1585138,1624034,1616785,1625916,1667582,1666996,1675013,1675316,1531316,1665413,1681719,1699880,1688696,623770,1727243,1531329,1683915,1689533,1738601,3756146,912118,3326933,3722005,3566478,1456622,1357994,1985670,1884075,1708065,1700322,2124484,3699046,2965313,4057963,4019126,3335202,2050466}

function eventNewPlayer(name)
for i,key in ipairs({32,40,83}) do
tfm.exec.bindKeyboard(name,key,true,true)
end
players[name]={
timestamp=os.time(),
offsets={x=2, y=10}
}
end

function eventKeyboard(name,key,down,x,y)
if (key==32 or key==40 or key==83) and not tfm.get.room.playerList[name].isDead and started then
if players[name].timestamp < os.time()-1000 then
local id
if tfm.get.room.playerList[name].isFacingRight then
id=tfm.exec.addShamanObject(24,x+players[name].offsets.x,y+players[name].offsets.y)
else
id=tfm.exec.addShamanObject(24,x+players[name].offsets.x,y+players[name].offsets.y)
end
players[name].timestamp=os.time()
table.insert(toDespawn,{os.time(),id})
end
end
end
function eventChatCommand(name,command)
local arg={}
for argument in command:gmatch("[^%s]+") do
table.insert(arg,argument)
end
if arg[1]=="off" then
if tonumber(arg[2]) and tonumber(arg[3]) then
players[name].offsets.x=tonumber(arg[2])
players[name].offsets.y=tonumber(arg[3])
else
players[name].offsets.x=2
players[name].offsets.y=10
end
tfm.exec.chatMessage("Offsets changed to X:"..players[name].offsets.x.." Y:"..players[name].offsets.y,name)
end
end

function eventNewGame()
started=false
end

function eventLoop(time,remaining)
if time >= 3000 and not started then
started=true
end
if remaining<=0 then
tfm.exec.newGame(maps[math.random(#maps)])
end
for i,cannon in ipairs(toDespawn) do
if cannon[1] <= os.time()-3000 then
tfm.exec.removeObject(cannon[2])
table.remove(toDespawn,i)
end
end
end

function eventPlayerDied(name)
local i=0
local n
for pname,player in pairs(tfm.get.room.playerList) do
if not player.isDead then
i=i+1
n=pname
end
end
if i==0 then
tfm.exec.newGame(maps[math.random(#maps)])
elseif i==1 then
tfm.exec.giveCheese(n)
tfm.exec.playerVictory(n)
tfm.exec.setGameTime(5)
end
end

for name,player in pairs(tfm.get.room.playerList) do
eventNewPlayer(name)
end

tfm.exec.newGame(maps[math.random(#maps)])

Does this help?
Mousechris
« Censeur »
1380928980000
    • Mousechris#0000
    • Profil
    • Derniers messages
    • Tribu
#362
  0
Is there a way to change "time left" and "mice" like there is to change shaman titles and tribe map code name?
Pleasedontcopymyname
« Citoyen »
1380929520000
    • Pleasedontcopymyname#0000
    • Profil
    • Derniers messages
    • Tribu
#363
  0
a dit :
tfm.exec.setGameTime(InsertTimeHere)



Note: I only know this command not the "!" command. Sorry ;n;
Mikuhl
« Citoyen »
1380929760000
    • Mikuhl#3311
    • Profil
    • Derniers messages
    • Tribu
#364
  0
Added a bunch of new stuff. And a snazzy logo.
Mousechris
« Censeur »
1380930900000
    • Mousechris#0000
    • Profil
    • Derniers messages
    • Tribu
#365
  0
how do you add sheeps into the map?
Mikuhl
« Citoyen »
1380931200000
    • Mikuhl#3311
    • Profil
    • Derniers messages
    • Tribu
#366
  0
Mousechris a dit :
how do you add sheeps into the map?

You could use the 'Add shaman object with mouse click' script, with the exact sheep enum, instead of the tfm.enum.
Mousechris
« Censeur »
1380931200000
    • Mousechris#0000
    • Profil
    • Derniers messages
    • Tribu
#367
  0
I figured but that's confusing me
Mikuhl
« Citoyen »
1380931320000
    • Mikuhl#3311
    • Profil
    • Derniers messages
    • Tribu
#368
  0
Mousechris a dit :
I figured but that's confusing me

40 is the ID for sheep.
Bengalstar
« Citoyen »
1380931800000
    • Bengalstar#0000
    • Profil
    • Derniers messages
#369
  0
Gamercp a dit :
Does this help?

w-wow thanks kind person
yes it helps sm tyvm
Epicshawty
« Citoyen »
1380935280000
    • Epicshawty#0000
    • Profil
    • Derniers messages
    • Tribu
#370
  0
I would just like to leave this here.

a dit :

ui.addPopup(0,0,"Text",NIL,200,155,500)
--The first 0 is the ID.
--The second 0 is a type (0=Close button,1=yes/no button,2=Player input)
--Replace text with whatever you like.
--NIL means to show it to everyone (replace it with "[username]" or simply name)
--200 is the X (usually I use 200 for regular maps, I use 400 for scrolling)
--The way I describe the Y is "up and down place", I use 155 all the time, works perfect for me.
--500 is the width (the fatness). 500 is usually perfect for me, but you can use a smaller width.

Just for the beginners who want popups.
Xanmeow
« Citoyen »
1380936180000
    • Xanmeow#0000
    • Profil
    • Derniers messages
    • Tribu
#371
  0
Epicshawty a dit :
I would just like to leave this here.


Just for the beginners who want popups.

to that script can you add pick the chat and it will show 2 pics and if they click the cat it says CORRECT! in a popup then you have a close button and if you pick the wrong one it will say WRONG! and close and it cmes up every 2 min
Epicshawty
« Citoyen »
1380936180000
    • Epicshawty#0000
    • Profil
    • Derniers messages
    • Tribu
#372
  0
Xanmeow a dit :
to that script can you add pick the chat and it will show 2 pics and if they click the cat it says CORRECT! in a popup then you have a close button and if you pick the wrong one it will say WRONG! and close and it cmes up every 2 min

That's up to the lua team. I'm just a junior yo
Xanmeow
« Citoyen »
1380936540000
    • Xanmeow#0000
    • Profil
    • Derniers messages
    • Tribu
#373
  0
Epicshawty a dit :
That's up to the lua team. I'm just a junior yo

well will someone help me? I got a little lua explerience but not ALOT only a ittle
so I kinda need help
Funkieee
« Citoyen »
1380937980000
    • Funkieee#0000
    • Profil
    • Derniers messages
    • Tribu
#374
  0
How do I make an admin rank? I saw some examples but any of those worked for me, and I don't even know where I have to put the table or script or how you want to call it :s
Sherr
« Censeur »
1380938220000
    • Sherr#0095
    • Profil
    • Derniers messages
    • Tribu
#375
  0
THANK YOU SO MUCH
Fierying
« Censeur »
1380938340000
    • Fierying#0000
    • Profil
    • Derniers messages
#376
  0
sorry to bother but how do you bind a map object with an image?
Shamousey
« Consul »
1380938880000
    • Shamousey#0095
    • Profil
    • Derniers messages
    • Tribu
#377
  0
Fierying a dit :
sorry to bother but how do you bind a map object with an image?

You can't, only people on the Lua Team can.
Lagiacrus
« Citoyen »
1380939480000
    • Lagiacrus#6060
    • Profil
    • Derniers messages
#378
  0
Shamousey a dit :
You can't, only people on the Lua Team can.

For very, very good reason too.
Mikuhl
« Citoyen »
1380974040000
    • Mikuhl#3311
    • Profil
    • Derniers messages
    • Tribu
#379
  0
The thread is now renamed, to be more uniform with the other Module API threads, and these do not exactly relate to the tribe house, as they can be used in an official module.
Aleeeeeh
« Citoyen »
1380974280000
    • Aleeeeeh#0000
    • Profil
    • Derniers messages
#380
  0
Lagiacruss a dit :
For very, very good reason too.

I'm courious, are these reasons stuff like preventing mice to use inappropriate pics or can't the server handle them?
  • Forums
  • /
  • Transformice
  • /
  • Modules
  • /
  • Lua Snippets
« ‹ 19 / 33 › »
© Atelier801 2018

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

Version 1.27