×

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
« ‹ 159 / 160 › »
Script Requests
Haytam
« Citoyen »
1615750320000
    • Haytam#0000
    • Profil
    • Derniers messages
    • Tribu
#3161
  0
how add random maps ?

i try map rotation but it's not working
Wwwarda
« Consul »
1615786200000
    • Wwwarda#0000
    • Profil
    • Derniers messages
    • Tribu
#3162
  0
Haytam a dit :
how add random maps ?

i try map rotation but it's not working

Code Lua

1
tfm.exec.newGame("#17")

for example this will open racing maps randomly
Haytam
« Citoyen »
1615921680000
    • Haytam#0000
    • Profil
    • Derniers messages
    • Tribu
#3163
  0
thanks you but not that what I'm looking for

i have a list of map i want it to run random that way when i try map rotation nothing really happen
Liberrate
« Citoyen »
1616054760000
    • Liberrate#0000
    • Profil
    • Derniers messages
#3164
  0
Hi friends I have question
After adding conjuration, can I get its properties? Like coordinates. I want to make minigame where we must click on spawning conjurates but I don't know how to get its coords, without writing it all static.
Adasmusio123
« Citoyen »
1617188760000
    • Adasmusio123#3114
    • Profil
    • Derniers messages
    • Tribu
#3165
  0
I want script that makes by command "!start" random player is killer but other players can't see this. Killer can pressing spac kill player near to him but can't kill shaman. Sorry for bad english, but i am from Poland.
King_seniru
« Censeur »
1617210120000
    • King_seniru#5890
    • Profil
    • Derniers messages
    • Tribu
#3166
  1
Haytam a dit :
thanks you but not that what I'm looking for

i have a list of map i want it to run random that way when i try map rotation nothing really happen

You might be looking for something like this


Liberrate a dit :
Hi friends I have question
After adding conjuration, can I get its properties? Like coordinates. I want to make minigame where we must click on spawning conjurates but I don't know how to get its coords, without writing it all static.

There is no way to access conjuration properties through the tfm.get tree. But you can do this simple thing :P
Code Lua

1
2
3
4
5
6
7
local conjurations = {} -- this is basically the table that stores all the conjuration coordinates.

-- assuming you have binded the mouse
function eventMouse(x, y, name)
tfm.exec.addConjuration(x, y)
conjurations[#conjurations + 1] = { x, y }
end

Dernière modification le 1618377420000
Blank
« Citoyen »
1617292620000
    • Blank#3495
    • Profil
    • Derniers messages
    • Tribu
#3167
  0
King_seniru a dit :

Code Lua

1
2
3
4
5
6
7
local conjurations = {} -- this is basically the table that stores all the conjuration coordinates.

-- assuming you have binded the mouse
function eventMouse(x, y, name)
tfm.exec.addConjuration(x, y)
conjuration[#conjuration + 1] = { x, y }
end

this will crash, because you're attempting to access a table in eventMouse that doesn't exist :P
Haytam
« Citoyen »
1617541620000
    • Haytam#0000
    • Profil
    • Derniers messages
    • Tribu
#3168
  0
King_seniru a dit :
Haytam a dit :
thanks you but not that what I'm looking for

i have a list of map i want it to run random that way when i try map rotation nothing really happen

You might be looking for something like this


Liberrate a dit :
Hi friends I have question
After adding conjuration, can I get its properties? Like coordinates. I want to make minigame where we must click on spawning conjurates but I don't know how to get its coords, without writing it all static.

There is no way to access conjuration properties through the tfm.get tree. But you can do this simple thing :P
Code Lua

1
2
3
4
5
6
7
local conjurations = {} -- this is basically the table that stores all the conjuration coordinates.

-- assuming you have binded the mouse
function eventMouse(x, y, name)
tfm.exec.addConjuration(x, y)
conjuration[#conjuration + 1] = { x, y }
end

that what i'm trying to say i try [Module API] [Tutorial] Map Rotation but it's not working
Adasmusio123
« Citoyen »
1618848720000
    • Adasmusio123#3114
    • Profil
    • Derniers messages
    • Tribu
#3169
  0
how can I get nearest player name(playerB) next to playerA(selected mouse)?
Kaido
« Citoyen »
1619019360000
    • Kaido#4722
    • Profil
    • Derniers messages
    • Tribu
#3170
  0
can anybody give me a script to freeze anybody with me in the tribe house if i writed his name?
King_seniru
« Censeur »
1619022960000
    • King_seniru#5890
    • Profil
    • Derniers messages
    • Tribu
#3171
  1
Haytam a dit :

that what i'm trying to say i try [Module API] [Tutorial] Map Rotation but it's not working

What is not working exactly? Did you try to follow up the tutorial


Adasmusio123 a dit :
how can I get nearest player name(playerB) next to playerA(selected mouse)?

Code Lua

1
2
3
4
5
6
7
8
9
10
11
12
13
14
function dist(x1, y1, x2, y2)
return ((x1 - x2) ^ 2 + (y1 - y2) ^ 2) ^ 0.5
end

local selected = tfm.get.room.playerList["King_seniru#5890"]
local pX, pY = selected.x, selected.y
local nearestPiece, nearestDist = nil, 1/0
for name, player in next, tfm.get.room.playerList do
local d = dist(pX, pY, player.x, player,y)
if d < nearestDist then
nearestDist = d
nearestPiece = piece
end
end

Kaido a dit :
can anybody give me a script to freeze anybody with me in the tribe house if i writed his name?

Code Lua

1
2
3
4
5
6
7
function eventChatMessage(name, message)
if tfm.get.room.platerList[message] then
tfm.exec.freezePlayer(message)
end
end

-- Say someone's name in room and this should work, assuming it is the only thing you wanted to do according to what you asked
Hufdasr
« Citoyen »
1619515740000
    • Hufdasr#0000
    • Profil
    • Derniers messages
    • Tribu
#3172
  0
Does anyone know how to start code by clicking the image? (I solve it with friend, in front of the picture must be text area with space and event)

Dernière modification le 1619535420000
Liberrate
« Citoyen »
1623872460000
    • Liberrate#0000
    • Profil
    • Derniers messages
#3173
  1
Can I set map by XML in lua, without tfm.exec.newGame()? When someone enters tribe house, he is not on map when map was loaded by tfm.exec.newGame(). How can I fix it?

edit: OK, I just added respawnPlayer() method after newGame().

Dernière modification le 1623877680000
Meowie
« Consul »
1627011540000
    • Meowie#5296
    • Profil
    • Derniers messages
    • Tribu
#3174
  1
perhaps a game show? any is fine
Yahyabe1
« Citoyen »
1630236600000
    • Yahyabe1#0000
    • Profil
    • Derniers messages
    • Tribu
#3175
  0
there any scirpt for four in a row minigame ؟
Meowie
« Consul »
1630505700000
    • Meowie#5296
    • Profil
    • Derniers messages
    • Tribu
#3176
  0
is there a script for like, calculating masses of certain items like cannons or stuff
King_seniru
« Censeur »
1643817660000
    • King_seniru#5890
    • Profil
    • Derniers messages
    • Tribu
#3177
  0
Yahyabe1 a dit :
there any scirpt for four in a row minigame ؟

Really late, but yes there is one here by Ninguem#0095

Meowie a dit :
is there a script for like, calculating masses of certain items like cannons or stuff

Not really sure why you need this, but here is a list of masses of all the shaman items. The same wiki might have the masses for stuff like mice and shamans too.
Wizardamani0
« Censeur »
1644351840000
    • Wizardamani0#6277
    • Profil
    • Derniers messages
    • Tribu
#3178
  0
i can use this in the tribe?
tfm.get.room.playerList["Wizardamani#6277"] look : 1;0,0,0,0,0,0,0,0,0
and how?
idk how pls help : )
G484
« Citoyen »
1645018560000
    • G484#5825
    • Profil
    • Derniers messages
    • Tribu
#3179
  0
A script when we press space near something Starts a dialog table
King_seniru
« Censeur »
1645026420000
    • King_seniru#5890
    • Profil
    • Derniers messages
    • Tribu
#3180
  0
Wizardamani0 a dit :
i can use this in the tribe?
tfm.get.room.playerList["Wizardamani#6277"] look : 1;0,0,0,0,0,0,0,0,0
and how?
idk how pls help : )

https://atelier801.com/topic?f=6&t=781139&p=19#m363

G484 a dit :
A script when we press space near something Starts a dialog table

Code Lua

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
math.pythag = function(x1, y1, x2, y2)
return ((x1 - x2) ^ 2 + (y1 - y2) ^ 2) ^ (1/2)
end

-- a table of objects, which has X,Y coordinates of all of them
-- however I suggest using XML processing instead of hardcoding, if the project is larger
local objects = {
{ 43, 10 },
{ 59, 10 }
}

eventNewPlayer = function(name)
system.bindKeyboard(name, 32, true, true) -- bind spacebar
end

eventKeyboard = function(name, key, down, x, y, down)
if key == 32 then
-- someone pressed space bar
for i, coords in next, objects do
if math.pythag(x, y, coords[1], coords[2]) <= 30 then -- if he pressed space near an object display the dialogue box
ui.addTextArea(0, "You pressed space bar!", name, 30, 30, 0, 0, nil, nil, 1, true)
end
end
end
end

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

Dernière modification le 1645026600000
  • Forums
  • /
  • Transformice
  • /
  • Modules
  • /
  • Script Requests
« ‹ 159 / 160 › »
© Atelier801 2018

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

Version 1.27