×

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
« ‹ 32 / 160 › »
Script Requests
Aigyptus
« Citoyen »
1386862440000
    • Aigyptus#0000
    • Profil
    • Derniers messages
#621
  0
How to bindkeyboard twice? It doesnt work if i execute bindkeyboard twice.
Shamousey
« Consul »
1386863340000
    • Shamousey#0095
    • Profil
    • Derniers messages
    • Tribu
#622
  0
You only need to bind each key once, what are you trying to accomplish for binding it twice?
Safwanrockz
« Censeur »
1386865920000
    • Safwanrockz#0095
    • Profil
    • Derniers messages
    • Tribu
#623
  0
Aigyptus a dit :
How to bindkeyboard twice? It doesnt work if i execute bindkeyboard twice.

Use the for statement.
a dit :
for _,key in ipairs({32,33}) do
tfm.exec.bindKeyboard("Aigyptus",key,true,true)
end

^Binds the 32 and 33 keys only for the specified player (you).
Bushmeister
« Consul »
1386872280000
    • Bushmeister#0000
    • Profil
    • Derniers messages
    • Tribu
#624
  0
Shamousey a dit :
Oops, fixed.

Thank you^^

How to use it
arguments a dit :
local arg={}
for argument in message:gmatch("[^%s]+") do
table.insert(arg,argument)
end

into
a dit :
function eventTextAreaCallback(id,name,callback)

?
Leo
« Citoyen »
1386872820000
    • Leo#6000
    • Profil
    • Derniers messages
#625
  0
print out text into the window and randomly How do I did, but it gives error.
Fuzzykeldeo
« Citoyen »
1386883800000
    • Fuzzykeldeo#0000
    • Profil
    • Derniers messages
#626
  0
When somebody enters the room, the chat says "<username> has entered the party!"
Safwanrockz
« Censeur »
1386884580000
    • Safwanrockz#0095
    • Profil
    • Derniers messages
    • Tribu
#627
  0
Bushmeister a dit :
Thank you^^

How to use it

into
?

As far as I could understand..
a dit :

ui.addTextArea(0, "<a href='event:vamp'>Turn to a vampire!</a>", nil)

function eventTextAreaCallback(name,id,cb)
if cb=='vamp' then
tfm.exec.setVampirePlayer(name)
end
end

Tutekkro a dit :
print out text into the window and randomly How do I did, but it gives error.

I don't understand. :x Can you elaborate a bit?
Fuzzykeldeo a dit :
When somebody enters the room, the chat says "&lt;username&gt; has entered the party!"

Bare in mind that you can't use tfm.exec.chatMessage, so you can replace it with ui.addTextArea.
a dit :

function eventNewPlayer(name)
ui.addTextArea(0, "<"..name.."> has entered the party!", nil)
end

 
Epiclolwut
« Citoyen »
1386887280000
    • Epiclolwut#0000
    • Profil
    • Derniers messages
#628
  0
I need something very small, basicly i need a LUA script that when someone types a command (Lets say !shaman) that it would make him shaman, I can understand the basic LUA but going to commands gives me some headaches. Thanks in advance.
Bushmeister
« Consul »
1386917880000
    • Bushmeister#0000
    • Profil
    • Derniers messages
    • Tribu
#629
  0
Safwanrockz a dit :
As far as I could understand..


I don't understand. :x Can you elaborate a bit?

Bare in mind that you can't use tfm.exec.chatMessage, so you can replace it with ui.addTextArea.
 

i'm sorry I meant
my fail a dit :
function eventPopupAnswer (id, playerName, answer)

Pmcarpan
« Citoyen »
1386924360000
    • Pmcarpan#0000
    • Profil
    • Derniers messages
    • Tribu
#630
  0
Epiclolwut a dit :
...

set shaman a dit :

--become shaman by typing !shaman
function eventChatCommand(p,msg)
if msg=="shaman" then
tfm.exec.setShaman(p)
end
end

Bushmeister a dit :
...

If you mean using the string:gmatch, then here is a code.
You can submit shaman[space]Username to make someone shaman.
Note that the first letter of Username must be caps.

code a dit :

--submit shaman [username] to kill someone
--like shaman Pmcarpan
ui.addPopup(0,2,"Enter message:",nil)
--user entry type popup

function eventPopupAnswer(id,p,msg)
if id==0 then
--splitting the msg by spaces

local arg={}

for argument in msg:gmatch("[^%s]+") do
table.insert(arg,argument)
end

if arg[1]=="shaman" then
tfm.exec.setShaman(arg[2])
end

arg={}
end
end
Safwanrockz
« Censeur »
1386925140000
    • Safwanrockz#0095
    • Profil
    • Derniers messages
    • Tribu
#631
  0
Bushmeister a dit :


Uhm, try this?
a dit :

ui.addPopup(0, 2, "Enter a command", nil)

function eventPopupAnswer(id,name,answer)
if answer=="vampire" then
tfm.exec.setVampirePlayer(name)
end
end

 
Bushmeister
« Consul »
1386931800000
    • Bushmeister#0000
    • Profil
    • Derniers messages
    • Tribu
#632
  0
Pmcarpan a dit :
If you mean using the string:gmatch, then here is a code.
You can submit shaman[space]Username to make someone shaman.
Note that the first letter of Username must be caps.

Thank you ^^
Safwanrockz a dit :
Uhm, try this?


ui.addPopup(0, 2, "Enter a command", nil)

function eventPopupAnswer(id,name,answer)
if answer=="vampire" then
tfm.exec.setVampirePlayer(name)
end
end

Thank you[2] :D
Shinymew
« Citoyen »
1386962520000
    • Shinymew#0000
    • Profil
    • Derniers messages
#633
  0
I want a script that changes mice speed and another one that changes the skills of all shamans.
Epiclolwut
« Citoyen »
1386975840000
    • Epiclolwut#0000
    • Profil
    • Derniers messages
#634
  0
Pmcarpan a dit :
If you mean using the string:gmatch, then here is a code.
You can submit shaman[space]Username to make someone shaman.
Note that the first letter of Username must be caps.

I wan't to thank you for the command but where does "p" stand for (found in "function eventChatCommand(p,msg)")
Shamousey
« Consul »
1386976740000
    • Shamousey#0095
    • Profil
    • Derniers messages
    • Tribu
#635
  0
Shinymew a dit :
I want a script that changes mice speed and another one that changes the skills of all shamans.

Neither of these things are practically possible.

You can move mice a little when they tap a direction key to give them a boost in one direction, but you can't make them move faster properly.

You can disable skills altogether and recode some of them - double tapping for projection, holding down spawns particles and shoots you up in the air (similar to #derby), spawning multiple balls, etc. but not all are possible.

Epiclolwut a dit :
I wan't to thank you for the command but where does "p" stand for (found in "function eventChatCommand(p,msg)")

The first argument returned in eventChatCommand is always the player's name.
Epiclolwut
« Citoyen »
1386977880000
    • Epiclolwut#0000
    • Profil
    • Derniers messages
#636
  0
Shamousey a dit :
-Snip-

Ah thank you, finnally this LUA API makes some sense for me :)
Lexipro
« Citoyen »
1386981960000
    • Lexipro#1805
    • Profil
    • Derniers messages
    • Tribu
#637
  0
I need script for banned in home tribe.
Bushmeister
« Consul »
1387016700000
    • Bushmeister#0000
    • Profil
    • Derniers messages
    • Tribu
#638
  0
Gygibecali a dit :
I need script for banned in home tribe.

old script...
http://pastebin.com/mecLGr2j
Abdeltif
« Citoyen »
1387033200000
    • Abdeltif#0000
    • Profil
    • Derniers messages
    • Tribu
#639
  0
a dit :
ui.addTextArea(0, "thing", nil, nil, nil, nil, nil, nil, nil, 0.5, true)

string = {}


function eventChatCommand(playerName, cmd)
if cmd:sub(0,1)=="p" then
table.insert(string, "<font color='#0880fe' size='16'><b>"..playerName.."</b></font> : <font size='16'>"..cmd:sub(3).."</font>")
elseif cmd=="reset" then
ui.updateTextArea(0, "<font size='18' color='#008000f'>Updated for the longest</font>")
elseif cmd=="input" then
ui.addPopup(1, 2, "<font color='#00800f' size='15.4'>Input</font>", playerName, 400, 50)
end
end

function eventLoop()
ui.updateTextArea(0, table.concat(string, "\n"))
end

function eventPopupAnwer(iD, playerName, ans)
if iD==1 then
table.insert(string, "<font color='#0880fe' size='16'><b>"..playerName.."</b></font> : <font size='16'>"..ans.."</font>")
end
end


system.disableChatCommandDisplay("p", true)
system.disableChatCommandDisplay("input", true)
system.disableChatCommandDisplay("reset", true)

When I do !input and whrite something it does not go to to string table
I guess something is wrong
HELP!
Safwanrockz
« Censeur »
1387034700000
    • Safwanrockz#0095
    • Profil
    • Derniers messages
    • Tribu
#640
  0
The second argument of table.insert is the string/variable which you want to insert in the specified table. What are you trying to do anyway, though?
  • Forums
  • /
  • Transformice
  • /
  • Modules
  • /
  • Script Requests
« ‹ 32 / 160 › »
© Atelier801 2018

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

Version 1.27