×

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
« ‹ 27 / 160 › »
Script Requests
Bushmeister
« Consul »
1385651160000
    • Bushmeister#0000
    • Profil
    • Derniers messages
    • Tribu
#521
  0
How to bind keyboard for those who in table?
Lua a dit :

blue = {}
function eventLoop()
tfm.exec.bindKeyboard(???)
end
function eventKeyboard(playerName, keyCode)
if keyCode==32 then
k=2
end
end
Safwanrockz
« Censeur »
1385653320000
    • Safwanrockz#0095
    • Profil
    • Derniers messages
    • Tribu
#522
  0
Bushmeister a dit :
How to bind keyboard for those who in table?

Code a dit :

blue = {}
function eventLoop()
for _,p in pairs(blue) do
tfm.exec.bindKeyboard(p,32,true,true)
end
end
function eventKeyboard(playerName, keyCode)
if keyCode==32 then
k=2
end
end

 
Shamousey
« Consul »
1385654400000
    • Shamousey#0095
    • Profil
    • Derniers messages
    • Tribu
#523
  0
Is there any reason that's in eventLoop? I don't see any need to bind keys for everyone every half a second.

If it's a predefined member list you want to bind, you could try something like this.

a dit :
for k,v in ipairs({"Safwanrockz","Bushmeister"}) do
tfm.exec.bindKeyboard(v,32,true,true)
end

 
Bushmeister
« Consul »
1385656140000
    • Bushmeister#0000
    • Profil
    • Derniers messages
    • Tribu
#524
  0
Thanks ^-^
Yes, it is nessecary, because after certain actions players will be added into table, and before that they should'nt have that key bind.
Cincle
« Citoyen »
1385661540000
    • Cincle#0000
    • Profil
    • Derniers messages
    • Tribu
#525
  0
Do you know that in *#battle minigame - This chest is empty! :'( How to make message like that? :3
Benbirkralm
« Citoyen »
1385667060000
    • Benbirkralm#0000
    • Profil
    • Derniers messages
    • Tribu
#526
  0
What is the "Press Space if you are in the chest and get -bla bla-" Code?
Cincle
« Citoyen »
1385667960000
    • Cincle#0000
    • Profil
    • Derniers messages
    • Tribu
#527
  0
Benbirkralm a dit :
What is the "Press Space if you are in the chest and get -bla bla-" Code?

Yes, I mean this!
Kmlcan
« Citoyen »
1385668320000
    • Kmlcan#0000
    • Profil
    • Derniers messages
    • Tribu
#528
  0
You guys need to use tfm.get.room.xmlMapInfo.xml and get the map's XML, then find the chest's XML code and do something like "if chest.x = playername.x and chest.y = playername.y then". For now I can't give the script but I think you'll figure it out.
Cincle
« Citoyen »
1385668860000
    • Cincle#0000
    • Profil
    • Derniers messages
    • Tribu
#529
  0
Kmlcan a dit :
You guys need to use tfm.get.room.xmlMapInfo.xml and get the map's XML, then find the chest's XML code and do something like "if chest.x = playername.x and chest.y = playername.y then". For now I can't give the script but I think you'll figure it out.

How about that Aww This Chest is empty? :( - I mean that message, not about space.
Kmlcan
« Citoyen »
1385668980000
    • Kmlcan#0000
    • Profil
    • Derniers messages
    • Tribu
#530
  0
Cincle a dit :
How about that Aww This Chest is empty? :( - I mean that message, not about space.

if playername.x ~= chest.x or playername.y ~= chest.y then
tfm.exec.chatMessage("Aww This Chest is empty!")
end

but as I said, you have to code it.
Cincle
« Citoyen »
1385669100000
    • Cincle#0000
    • Profil
    • Derniers messages
    • Tribu
#531
  0
Kmlcan a dit :
if playername.x ~= chest.x or playername.y ~= chest.y then
tfm.exec.chatMessage("Aww This Chest is empty!")
end

but as I said, you have to code it.

Thanks, I will try to code it. ^^
EDIT: I pressed space but it Is not working :C
Safwanrockz
« Censeur »
1385670480000
    • Safwanrockz#0095
    • Profil
    • Derniers messages
    • Tribu
#532
  0
Cincle a dit :
Thanks, I will try to code it. ^^
EDIT: I pressed space but it Is not working :C

It is pretty hard (for a beginner) to use tfm.get.room.xmlMapInfo.xml and get the map's XML to apply it on specific variables and tables that include the chest coordinates.
Kathiehuang
« Citoyen »
1385678160000
    • Kathiehuang#0000
    • Profil
    • Derniers messages
    • Tribu
#533
  0
An image of a turkey to appear on the screen? .3.
Shamousey
« Consul »
1385678280000
    • Shamousey#0095
    • Profil
    • Derniers messages
    • Tribu
#534
  0
Kathiehuang a dit :
An image of a turkey to appear on the screen? .3.

People who aren't on the Lua Team can't use images.
Zyx
« Censeur »
1385698560000
    • Zyx#8690
    • Profil
    • Derniers messages
#535
  0
A type of game requested from my friend.

She wants to make like, me as slenderman where it's a game where I appear to people. The whole plot is from the SlenderMan game.
Map might be included.
Dazdalolz
« Citoyen »
1385713140000
    • Dazdalolz#0000
    • Profil
    • Derniers messages
    • Tribu
#536
  0
A script that can make me an "admin" and I can turn on/off collision by saying !collision
?
Safwanrockz
« Censeur »
1385722980000
    • Safwanrockz#0095
    • Profil
    • Derniers messages
    • Tribu
#537
  0
Swirlfire a dit :
A type of game requested from my friend. She wants to make like, me as slenderman where it's a game where I appear to people. The whole plot is from the SlenderMan game. Map might be included.


I am currently thinking of coding one, it'd take long.

Dazdalolz a dit :
A script that can make me an "admin" and I can turn on/off collision by saying !collision ?


Try this.
a dit :

local xml = nil
local isAdmin={Dazdalolz=true}


function eventNewGame()
if tfm.get.room.xmlMapInfo and tfm.get.room.xmlMapInfo.author ~= "#Module" and tfm.get.room.xmlMapInfo.xml then
xml = string.gsub(tfm.get.room.xmlMapInfo.xml, "<P", "<P C=\"\"", 1)
end
end

function eventChatCommand(name,cmd)
if cmd=="collision" and xml and isAdmin[name] then
tfm.exec.disableAutoShaman(false)
tfm.exec.newGame(xml)
tfm.exec.disableAutoShaman(true)
xml = nil
end
end

tfm.exec.newGame()

 
Tasted
« Citoyen »
1385744760000
    • Tasted#0000
    • Profil
    • Derniers messages
    • Tribu
#538
  0
So, I want to make a popout that will be appeared when the mouse type '!dajser' (from the Polish - give cheese). When you enter the correct password to popout mouse gets cheese.

I already have something like this:
a dit :
function eventChatCommand(playerName, command)
[...]
elseif command=="dajser" then
ui.addPopup(0, 2, "Podaj hasło. :D", playerName, 100, 100, 0)
[...]
end
end

function eventPopupAnswer(0, playerName, ":P")
tfm.exec.giveCheese(playerName)

Polish player thanks!
Shamousey
« Consul »
1385745120000
    • Shamousey#0095
    • Profil
    • Derniers messages
    • Tribu
#539
  0
Tasted a dit :
So, I want to make a popout that will be appeared when the mouse type '!dajser' (from the Polish - give cheese). When you enter the correct password to popout mouse gets cheese.

I already have something like this:

function eventChatCommand(playerName, command)
if command=="dajser" then
ui.addPopup(0, 2, "Podaj hasło. :D", playerName, 100, 100, 0)
end
end

function eventPopupAnswer(id, playerName, callback)
if callback==":P" then
tfm.exec.giveCheese(playerName)
end
end
Tasted
« Citoyen »
1385746020000
    • Tasted#0000
    • Profil
    • Derniers messages
    • Tribu
#540
  0
Ah, callback. ._.
Thanks.
  • Forums
  • /
  • Transformice
  • /
  • Modules
  • /
  • Script Requests
« ‹ 27 / 160 › »
© Atelier801 2018

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

Version 1.27