×

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
« ‹ 14 / 160 › »
Script Requests
Issey
« Citoyen »
1382574300000
    • Issey#0000
    • Profil
    • Derniers messages
#261
  0
Shamousey a dit :
table.remove only removes the key from a table, I recommend you look up how it works in the Lua Manual.


Some bugs are fun but can get annoying. I wrote a function to get the two top players and make them shaman, it works well for the most part but occasionally this happens, anyone care to come up with a foolproof method?

Atleast post the script you use right now smh
Petrenrenpet
« Citoyen »
1382575860000
    • Petrenrenpet#0000
    • Profil
    • Derniers messages
    • Tribu
#262
  0
How I make a sistem of words randomly...?
[#mach]... ...
Shamousey
« Consul »
1382578260000
    • Shamousey#0095
    • Profil
    • Derniers messages
    • Tribu
#263
  0
Mousechris a dit :
Could someone help me?

I'm trying to make it so if you press space bar, you die and turn turn into an Icecube, then when you repress space bar, you turn back into a mouse at the same X/Y cooridiates as your icecube.

This isn't the most effective way to do it ever, but it works like you requested.

a dit :
players={}
for name,player in pairs(tfm.get.room.playerList) do
tfm.exec.bindKeyboard(name,32,true,true)
players[name]={}
end

function eventKeyboard(name,key,down,x,y)
if key==32 then
if tfm.get.room.playerList[name].isDead then
if players[name].x and players[name].y and players[name].id then
tfm.exec.respawnPlayer(name)
tfm.exec.movePlayer(name,tfm.get.room.objectList[players[name].id].x,tfm.get.room.objectList[players[name].id].y)
tfm.exec.removeObject(players[name].id)
end
else
tfm.exec.killPlayer(name)
local id=tfm.exec.addShamanObject(tfm.enum.shamanObject.iceCube,x,y)
players[name]={id=id,x=x,y=y}
end
end
end

Petrenrenpet a dit :
How I make a sistem of words randomly...?
[#mach]... ...

You can keep them in a table, then call them up using math.random.

a dit :
words={"pineapple","walrus","hamster","sydoline smells funny","fish","pwet"}
word=words[math.random(#words)]
print(word)

Petrenrenpet
« Citoyen »
1382579040000
    • Petrenrenpet#0000
    • Profil
    • Derniers messages
    • Tribu
#264
  0
Ohhh thank! But... how i spawn two "ui.addPopup"?
Shamousey
« Consul »
1382579160000
    • Shamousey#0095
    • Profil
    • Derniers messages
    • Tribu
#265
  0
Petrenrenpet a dit :
Ohhh thank! But... how i spawn two "ui.addPopup"?

Just make sure you use different IDs.
Petrenrenpet
« Citoyen »
1382579580000
    • Petrenrenpet#0000
    • Profil
    • Derniers messages
    • Tribu
#266
  0
Thank <3
Mousechris
« Censeur »
1382590560000
    • Mousechris#0000
    • Profil
    • Derniers messages
    • Tribu
#267
  0
a dit :
tfm.exec.disableAutoNewGame(true)
maps={4414828}
function eventLoop(time,remaining)
if remaining<=0 then tfm.exec.newGame(maps[math.random(#maps)]) end
end

tfm.exec.disableAutoTimeLeft(true)
players={}
for name,player in pairs(tfm.get.room.playerList) do
tfm.exec.bindKeyboard(name,32,true,true)
players[name]={}
end
function eventKeyboard(name,key,down,x,y)
if key==32 then
if tfm.get.room.playerList[name].isDead then
if players[name].x and players[name].y and players[name].id then
tfm.exec.respawnPlayer(name)
tfm.exec.movePlayer(name,tfm.get.room.objectList[players[name].id].x,tfm.get.room.objectList[players[name].id].y)
tfm.exec.removeObject(players[name].id)
end
else
tfm.exec.killPlayer(name)
local id=tfm.exec.addShamanObject(tfm.enum.shamanObject.iceCube,x,y)
players[name]={id=id,x=x,y=y}
end
end
end

I'm trying to add an ice plank to another key, how would I do this, and how do I place iceplank and icecubes as differant keys?
Safwanrockz
« Censeur »
1382612220000
    • Safwanrockz#0095
    • Profil
    • Derniers messages
    • Tribu
#268
  0
Hmm, I don't think you can spawn an ice plank with lua - anyway, I haven't checked the full enums list.
Issey
« Citoyen »
1382620380000
    • Issey#0000
    • Profil
    • Derniers messages
#269
  0
Shamousey a dit :
Some bugs are fun but can get annoying. I wrote a function to get the two top players and make them shaman, it works well for the most part but occasionally this happens, anyone care to come up with a foolproof method?

Dublew Shaman a dit :
playerList=tfm.get.room.playerList

function setShaman()
local shaman=nil
local shaman2=nil
topPlayers={}
n=0
for name in pairs(playerList) do n=n+1 end
if(n==1) then print('not nuff players yo')
else
i=0
n=0
for name in pairs(playerList) do
if(playerList[name].score>=i) then
i=playerList[name].score
shaman=name
end
end
for name in pairs(playerList) do
if name~=shaman then
if(shaman2==nil) then
if(playerList[name].score==i) then
shaman2=name
elseif(playerList[name].score<i) and (playerList[name].score>n) then
n=playerList[name].score
shaman2=name
end
end
end
end

I think this might work idk ok
Doneky
« Citoyen »
1382621400000
    • Doneky#0000
    • Profil
    • Derniers messages
    • Tribu
#270
  0
Please help me:
a dit :
Lideres = {Doneky = true}
Banidos = {}

function eventNewGame()
for name,player in pairs(Banidos) do
tfm.exec.killPlayer(playerName)
end
end

function eventChatCommand(playerName,command)
if command == [[ban]] then
if Lideres[playerName] == true then
ui.addPopup(0,2,[[Banir o Jogador:]],playerName,300,150,200)
end

elseif command == [[banlist]] then
for name,player in pairs(Banidos) do
print(playerName)
end
end
end

function eventPopupAnswer(id, playerName, answer)
if id == 0 then
table.insert(Banidos,answer)
print([[&amp;lt;r&amp;gt;Jogador Banido&amp;lt;/r&amp;gt;]])
end
end

It don't is working.
Issey
« Citoyen »
1382621940000
    • Issey#0000
    • Profil
    • Derniers messages
#271
  0
Doneky a dit :
Please help me:

It don't is working.

tfm.exec.killPlayer(name)
Doneky
« Citoyen »
1382623740000
    • Doneky#0000
    • Profil
    • Derniers messages
    • Tribu
#272
  0
Issey a dit :
tfm.exec.killPlayer(name)

The problem continue yet.
The problem is that person no is being banned and don't die in next round.
Shamousey
« Consul »
1382623980000
    • Shamousey#0095
    • Profil
    • Derniers messages
    • Tribu
#273
  0
Doneky a dit :
Please help me:

It don't is working.

There are several issues in this script, mainly you're trying to kill the key (a number) in the table and not the value (the player's name). Try finding out how to use tables, or for a simple fix change it to tfm.exec.killPlayer(player).
Enginfener
« Citoyen »
1382624460000
    • Enginfener#0000
    • Profil
    • Derniers messages
    • Tribu
#274
  0
Statistics table is there.
Shamousey
« Consul »
1382624640000
    • Shamousey#0095
    • Profil
    • Derniers messages
    • Tribu
#275
  0
Enginfener a dit :
Statistics table is there.

What do you mean by this?
Nicknamepll
« Citoyen »
1382628720000
    • Nicknamepll#0000
    • Profil
    • Derniers messages
    • Tribu
#276
  0
How to made two jumps?

Only two.
Shamousey
« Consul »
1382629080000
    • Shamousey#0095
    • Profil
    • Derniers messages
    • Tribu
#277
  0
Nicknamepll a dit :
How to made two jumps?

Only two.

You can't detect when someone hits the ground, so you can't make a double-jump very well.
Nicknamepll
« Citoyen »
1382629500000
    • Nicknamepll#0000
    • Profil
    • Derniers messages
    • Tribu
#278
  0
Shamousey a dit :
You can't detect when someone hits the ground, so you can't make a double-jump very well.

My point here is that if the two times I click the up arrow to jump mouse me twice not three not four but two
Rigbylua
« Citoyen »
1382630100000
    • Rigbylua#0000
    • Profil
    • Derniers messages
    • Tribu
#279
  0
fix please
code a dit :


translations={
EN={
help={
"Here is your help.",
"What happens if the text on this second page is so insanely long, will it cut itself off to the next line? I hope so.",
"Here's a third page, oh my god!",
}
}
}

players={}
system.disableChatCommandDisplay("help")

textarea=ui.addTextArea
function ui.addTextArea(id,text,targetPlayer,x,y,width,height,backgroundColor,borderColor,backgroundAlpha,emboss)
--if not backgroundColor then backgroundColor=0x324650 end
--if not borderColor then borderColor=0x000001 end
if emboss then
textarea(6969+id,"",targetPlayer,x,y+1,width,height,0x000001,0x000001,backgroundAlpha)
textarea(7979+id,"",targetPlayer,x,y-1,width,height,0x6A8FA2,0x6A8FA2,backgroundAlpha)
end
textarea(id,text,targetPlayer,x,y,width,height,backgroundColor,borderColor,backgroundAlpha)
end

function eventNewPlayer(name)
players[name]={helpid=1}
ui.addTextArea(0,"?
",name,780,374,16,16,nil,0x324650,nil,true)
end

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

function trans(mes)
if translations[tfm.get.room.community] and translations[tfm.get.room.community][mes] then
return translations[tfm.get.room.community][mes]
else
return translations.EN[mes]
end
end

function eventChatCommand(name,command)
if command=="help" then
ui.addTextArea(1,trans("help")[players[name].helpid],name,250,50,300,300,nil,0x324650,nil,true)
ui.addTextArea(2,"<
",name,500,365,16,16,nil,0x324650,nil,true)
ui.addTextArea(3,">
",name,532,365,16,16,nil,0x324650,nil,true)
ui.addTextArea(4,"Close
",name,442,365,42,16,nil,0x324650,nil,true)
ui.addTextArea(5,""..players[name].helpid.."/"..#trans("help").."
",name,250,365,42,16,nil,0x324650,nil,true)
end
end

function eventTextAreaCallback(id,name,callback)
if callback=="help" then
eventChatCommand(name,callback)
elseif callback=="close" then
players[name].helpid=1
for id=1,5 do
ui.removeTextArea(id,name)
ui.removeTextArea(6969+id,name)
ui.removeTextArea(7979+id,name)
end
elseif callback=="next" and players[name].helpid


.
Shamousey
« Consul »
1382630520000
    • Shamousey#0095
    • Profil
    • Derniers messages
    • Tribu
#280
  0
Rigbylua a dit :
fix please

You took this from page 14 of the Lua Snippets thread - my post got a bit messed up but I've fixed it now, go back there to get the right version.
  • Forums
  • /
  • Transformice
  • /
  • Modules
  • /
  • Script Requests
« ‹ 14 / 160 › »
© Atelier801 2018

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

Version 1.27