×

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
« ‹ 24 / 160 › »
Script Requests
Kathiehuang
« Citoyen »
1384197120000
    • Kathiehuang#0000
    • Profil
    • Derniers messages
    • Tribu
#461
  0
Um, a script to kill a certain person?
Shamousey
« Consul »
1384198260000
    • Shamousey#0095
    • Profil
    • Derniers messages
    • Tribu
#462
  0
Kathiehuang a dit :
Um, a script to kill a certain person?

tfm.exec.killPlayer("Kathiehuang")
Kathiehuang
« Citoyen »
1384198380000
    • Kathiehuang#0000
    • Profil
    • Derniers messages
    • Tribu
#463
  0
Shamousey a dit :
tfm.exec.killPlayer("Kathiehuang")

Thanks :3
Sandermr
« Citoyen »
1384200060000
    • Sandermr#0000
    • Profil
    • Derniers messages
    • Tribu
#464
  0
Sham (or anyone else) could you help me my script (previouse page)?
Grimrice
« Citoyen »
1384210680000
    • Grimrice#0000
    • Profil
    • Derniers messages
    • Tribu
#465
  0
Is there a way to allow collision in tribe house maps? with a single code?
Jordy
« Consul »
1384255560000
    • Jordy#0015
    • Profil
    • Derniers messages
    • Tribu
#466
  0
Grimrice a dit :
Is there a way to allow collision in tribe house maps? with a single code?

Unfortunately you can't alter the collision mode with Lua.

Edit: Apparently you can.
Makinit
« Citoyen »
1384259400000
    • Makinit#0095
    • Profil
    • Derniers messages
    • Tribu
#467
  0
Grimrice a dit :
Is there a way to allow collision in tribe house maps? with a single code?

This reloads any user map to enable collision:
example a dit :
local xml = nil
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 eventLoop(t)
if xml and t > 3000 then
tfm.exec.disableAutoShaman(false)
tfm.exec.newGame(xml)
tfm.exec.disableAutoShaman(true)
xml = nil
end
end

tfm.exec.newGame()
Grimrice
« Citoyen »
1384272120000
    • Grimrice#0000
    • Profil
    • Derniers messages
    • Tribu
#468
  0
Makinit a dit :
This reloads any user map to enable collision:

thank you thank youuu
Davidelire
« Citoyen »
1384275540000
    • Davidelire#0000
    • Profil
    • Derniers messages
    • Tribu
#469
  0
Makinit a dit :
xml = string.gsub(tfm.get.room.xmlMapInfo.xml, "<P", "<P C=\"\"", 1)

But we can't add ground with that ?
Makinit
« Citoyen »
1384276200000
    • Makinit#0095
    • Profil
    • Derniers messages
    • Tribu
#470
  0
Davidelire a dit :
But we can't add ground with that ?

You can alter the xml in any way, this just adds the collision argument.
Grimrice
« Citoyen »
1384289760000
    • Grimrice#0000
    • Profil
    • Derniers messages
    • Tribu
#471
  0
okay leme change this: a code that works in tribe house, that does not turn anyone into shaman, infinite time/spawning and allows collision in normal tribe map and any user maps whilst we do ./np @xxxx... and does not restart map changing players positions.
Shamousey
« Consul »
1384291680000
    • Shamousey#0095
    • Profil
    • Derniers messages
    • Tribu
#472
  0
Grimrice a dit :
that does not turn anyone into shaman

tfm.exec.disableAutoShaman(true)

Grimrice a dit :
infinite time/spawning

tfm.exec.disableAutoNewGame(true)

Grimrice a dit :
allows collision in normal tribe map and any user maps whilst we do ./np @xxxx... and does not restart map changing players positions.

It's not possible to do this - the only way that collision can be added to a map is by getting the XML, adding collision to it, then reloading it - which resets everyone's positions anyway.
Sandermr
« Citoyen »
1384291920000
    • Sandermr#0000
    • Profil
    • Derniers messages
    • Tribu
#473
  0
Hi, I made a script which asks a question to all mice in the room and checks how many mice answered yes, then does an action depending on how many mice answered yes (in this case, half or more).

So it's working so far but I have a problem, if someone is afk or just not bothered to answer the question none of the actions are done because it waits for that afk to answer so what I need added to the script is a way that if someone doesn't answer in X amount of time their answer becomes nil or something like that.

Script:
a dit :
function CheckMice()
mice=0
for player, name in pairs(tfm.get.room.playerList) do
mice=mice+1
end
end
CheckMice()

function Question()
answered=0
yes=0
ui.addPopup(99, 1, "Question", nil, 250, 150, 250)
end
Question()

function eventPopupAnswer(id, name, ans)
if (id == 99) then
answered=answered+1
print(name.." answered: "..ans)
if (ans=="yes") then
yes=yes+1
end
print("Number of answers: "..answered)
print("Number of Yes: "..yes)

if (answered == mice) then
if (yes <= mice*0.5) then
-- Do something
else
-- Do something else
end
end
end
end

.
Mousechris
« Censeur »
1384308180000
    • Mousechris#0000
    • Profil
    • Derniers messages
    • Tribu
#474
  0
a dit :
help={
"<p align='center'><b><font size='40' face='WST_Fren'>Happy Thanksgiving!</b></p><br/><br/><br/><br/>",
"<p align='center'><b><font size='40' face='WST_Fren'>Rules</b></p><br/><br/><br/><br/>"
}

players={}

for i,command in ipairs({"t","m","help"}) do
system.disableChatCommandDisplay(command,true)
end

function eventNewPlayer(name)
players[name]={helpid=1}
ui.addTextArea(250,450,300,300,0x324650,0x324650,nil)
ui.addTextArea(0,"<p align='center'><a href='event:help'><b>Click Me!</b></a></p>",name,10,774,80,16,0x3C5064,0x3C5064,1,nil,true)
end

function eventChatCommand(name,command)
local split=string.find(command," ") or #command+1
local cmd=string.sub(command,1,split-1)
local args=string.sub(command,split+1)
local arg={}
for argument in args:gmatch("[^%s]+") do
table.insert(arg,argument)
end
if cmd == "t" then
tfm.exec.setUIMapName("<V>[Stalker Chat] ["..name.."]<N> "..args.."\n")
elseif cmd == "m" then
tfm.exec.setUIMapName("<ROSE>• [Modération] ["..name.."] "..args.."\n")
elseif command=="help" then
ui.addTextArea(1,help[players[name].helpid],name,250,450,300,300,0x324650,0x324650,nil)
ui.addTextArea(2,"<p align='center'><a href='event:previous'><b>▲</b></a></p>",name,565,704,16,16,0x324650,0x324650,nil)
ui.addTextArea(3,"<p align='center'><a href='event:next'><b>▼</b></a></p>",name,565,734,16,16,0x324650,0x324650,nil)
ui.addTextArea(4,"<p align='center'><a href='event:close'><b>X</b></a></p>",name,565,674,16,16,0x324650,0x324650,nil)
ui.addTextArea(5,"<p align='center'>"..players[name].helpid.."/"..#help.."</p>",name,250,734,40,16,0x324650,0x324650,nil)
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)
end
elseif callback=="next" and players[name].helpid<#help then
players[name].helpid=(players[name].helpid)+1
ui.updateTextArea(1,help[players[name].helpid],name)
ui.updateTextArea(5,"<p align='center'>"..players[name].helpid.."/"..#help.."</p>",name)
elseif callback=="previous" and players[name].helpid>1 then
players[name].helpid=players[name].helpid-1
ui.updateTextArea(1,help[players[name].helpid],name)
ui.updateTextArea(5,"<p align='center'>"..players[name].helpid.."/"..#help.."</p>",name)
end
end

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

at line 14 I tried making an extra text area, how do i do this >.>
Doneky
« Citoyen »
1384312140000
    • Doneky#0000
    • Profil
    • Derniers messages
    • Tribu
#475
  0
I wanted a script similar the keyhunt and/or cheesehunt.
Note: Is system where the player enter the key (32) in something place of map and it, will to win +1 points.

Example: If player enter the key (32) in coordinates 400x, 200y, it to will win +1 points in the rank of room, and in coordinates 600x,200y it will win +1 points.
Pmcarpan
« Citoyen »
1384335720000
    • Pmcarpan#0000
    • Profil
    • Derniers messages
    • Tribu
#476
  0
@Mousechris If you look carefully, you have missed out the id,text and targetplayer. Further, if you add those, it will be added BEHIND the chatbox.
For the text area at line 15, it's way low(the y co-ordinates).

@Doneky

bad code a dit :

for name,player in pairs(tfm.get.room.playerList) do
tfm.exec.bindKeyboard(name,32,true,true)
tfm.exec.setPlayerScore(name,0,false)
end

function eventKeyboard(name,id,press,px,py)
if id==32 and press==true and px==400 and py==200 then
tfm.exec.setPlayerScore(name,1,true)
elseif id==32 and press==true and px==400 and py==200 then
tfm.exec.setPlayerScore(name,1,true)
end
end

You should add something to check through a particular set of co-ordinates probably...
Doneky
« Citoyen »
1384352220000
    • Doneky#0000
    • Profil
    • Derniers messages
    • Tribu
#477
  0
Pmcarpan a dit :
[...]

It is giving very fails and don't is working right.
Tailtong
« Citoyen »
1384355280000
    • Tailtong#0000
    • Profil
    • Derniers messages
    • Tribu
#478
  0
That's why it's called bad code, don't use that one. Work a better one out yourself.
Safwanrockz
« Censeur »
1384362480000
    • Safwanrockz#0095
    • Profil
    • Derniers messages
    • Tribu
#479
  0
Doneky a dit :
It is giving very fails and don't is working right.

Because you can't reach one specific x y coordinates, you should use the <> statements.
Kmlcan
« Citoyen »
1384377060000
    • Kmlcan#0000
    • Profil
    • Derniers messages
    • Tribu
#480
  0
Uh, I can't use down thingy in eventKeyboard, can anybody give me an example? How can I use that?
  • Forums
  • /
  • Transformice
  • /
  • Modules
  • /
  • Script Requests
« ‹ 24 / 160 › »
© Atelier801 2018

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

Version 1.27