×

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
« ‹ 133 / 160 › »
Script Requests
Denyelxxx
« Citoyen »
1509890760000
    • Denyelxxx#0000
    • Profil
    • Derniers messages
#2641
  0
I want to make a wedding map and i woud like an script to make this image appear after they kiss for a few seconds (http://transformice.com/images/x_temps/x_ieh/J6_VCi8tPeA.png ) or for XML ( x_temps/x_ieh/J6_VCi8tPeA.png ) i already know how to add an image to the map i want to but i don't know how to make it appear only when i want.
Jwpdde
« Citoyen »
1509985080000
    • Jwpdde#0000
    • Profil
    • Derniers messages
#2642
  0
How to make a map of XML code appear after the "map" command? for example ....

CODE
<C><P /><Z><S><S L="32" H="10" X="317" Y="346" T="0" P="0,0,0.3,0.2,0,0,0,0" /><S L="817" H="69" X="421" Y="385" T="0" P="0,0,0.3,0.2,0,0,0,0" /><S L="264" H="41" X="345" Y="233" T="0" P="0,0,0.3,0.2,0,0,0,0" /><S L="124" H="10" X="146" Y="107" T="0" P="0,0,0.3,0.2,0,0,0,0" /><S L="115" H="10" X="306" Y="90" T="0" P="0,0,0.3,0.2,0,0,0,0" /><S L="103" H="31" X="553" Y="127" T="0" P="0,0,0.3,0.2,0,0,0,0" /><S L="10" H="10" X="648" Y="160" T="0" P="0,0,0.3,0.2,0,0,0,0" /><S L="10" H="56" X="677" Y="220" T="0" P="0,0,0.3,0.2,0,0,0,0" /><S L="10" H="32" X="686" Y="285" T="0" P="0,0,0.3,0.2,0,0,0,0" /></S><D /><O /></Z></C>


And how to add your picture to the map?

Denyelxxx a dit :
I want to make a wedding map and i woud like an script to make this image appear after they kiss for a few seconds (http://transformice.com/images/x_temps/x_ieh/J6_VCi8tPeA.png ) or for XML ( x_temps/x_ieh/J6_VCi8tPeA.png ) i already know how to add an image to the map i want to but i don't know how to make it appear only when i want.

Are you in a group of luers? If not, you can not add a photo to the map using the LUA code.

Dernière modification le 1510416000000
Mawcn
« Citoyen »
1510498740000
    • Mawcn#0000
    • Profil
    • Derniers messages
    • Tribu
#2643
  0
I hope this is what you mean.

1
tfm.exec.newGame('<C><P /><Z><S><S L="32" H="10" X="317" Y="346" T="0" P="0,0,0.3,0.2,0,0,0,0" /><S L="817" H="69" X="421" Y="385" T="0" P="0,0,0.3,0.2,0,0,0,0" /><S L="264" H="41" X="345" Y="233" T="0" P="0,0,0.3,0.2,0,0,0,0" /><S L="124" H="10" X="146" Y="107" T="0" P="0,0,0.3,0.2,0,0,0,0" /><S L="115" H="10" X="306" Y="90" T="0" P="0,0,0.3,0.2,0,0,0,0" /><S L="103" H="31" X="553" Y="127" T="0" P="0,0,0.3,0.2,0,0,0,0" /><S L="10" H="10" X="648" Y="160" T="0" P="0,0,0.3,0.2,0,0,0,0" /><S L="10" H="56" X="677" Y="220" T="0" P="0,0,0.3,0.2,0,0,0,0" /><S L="10" H="32" X="686" Y="285" T="0" P="0,0,0.3,0.2,0,0,0,0" /></S><D /><O /></Z></C>');

You can only add pictures that exists in the Atelier801 Image Database, but it works only in the map editor. That means it's not possible to add image by LUA script. To see a example of using them in the map editor see here.

Dernière modification le 1510498980000
Muutluerkek
« Citoyen »
1511615700000
    • Muutluerkek#0000
    • Profil
    • Derniers messages
    • Tribu
#2644
  0
I'm mycity source code claim :D aa sorry im old time i maked mycity source code :D

Code

Dernière modification le 1511615760000
Syrius
« Consul »
1511965800000
    • Syrius#8114
    • Profil
    • Derniers messages
    • Tribu
#2645
  0
Please show how to make playername into variable for cmd function to do like this "!ban [#playername]"

And make it compatible with this command system:
Code Lua

1
2
3
function eventChatCommand(name,cmd,n)
if cmd=='example' then Example() end
end
Sebafrancuz
« Consul »
1511971980000
    • Sebafrancuz#0000
    • Profil
    • Derniers messages
    • Tribu
#2646
  0
Marciskris a dit :
Please show how to make playername into variable for cmd function to do like this "!ban [#playername]"

And make it compatible with this command system:
Code Lua

1
2
3
function eventChatCommand(name,cmd,n)
if cmd=='example' then Example() end
end

I hope it's working (I didn't test it yet):
Code

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
30
31
32
33
34
35
36
37
38
39
local ban = {} -- creates new table
local map = "0"

function Example(p)
ban[p] = true; --sets boolean ban for player to true
tfm.exec.killPlayer(p); --kills player
end

function SetUp()
foreach(tfm.get.room.playerList, eventNewPlayer); -- gives all indexes from tfm.get.room.playerList (players who are on the room) to argument first of eventNewPlayer
for _, values in next, {"AfkDeath", "AutoNewGame", "AutoTimeLeft", "AutoShaman"} do
tfm.exec["disable"..values]();
end
tfm.exec.newGame(map); -- it should be a map, because if it doesn't then killing won't work
end

function eventNewPlayer(p)
ban[p] = ban[p] or false; -- creating new boolean variable in ban table for every player who joined and set it to false if it isn't exist
if(ban[p]) then
tfm.exec.killPlayer(p); -- if ban is true then kill player
else
tfm.exec.respawnPlayer(p); -- if ban is false then respawn player
end
end

function eventPlayerDied(p)
if(not(ban[p])) then -- if player isn't banned (if player's boolean ban isn't true) then respawn
tfm.exec.respawnPlayer(p);
end
end


function eventChatCommand(name,cmd)
if(cmd:sub(0,3)=="ban") then -- if from 0th character to 3rd character string is "ban" then
Example(cmd:sub(5)); -- use function Example and setting it's first argument from 5th character
end
end

SetUp();

Dernière modification le 1512026940000
Syrius
« Consul »
1512045660000
    • Syrius#8114
    • Profil
    • Derniers messages
    • Tribu
#2647
  0
Sebafrancuz a dit :
Marciskris a dit :
Please show how to make playername into variable for cmd function to do like this "!ban [#playername]"

And make it compatible with this command system:
Code Lua

1
2
3
function eventChatCommand(name,cmd,n)
if cmd=='example' then Example() end
end

I hope it's working (I didn't test it yet):
Code

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
30
31
32
33
34
35
36
37
38
39
local ban = {} -- creates new table
local map = "0"

function Example(p)
ban[p] = true; --sets boolean ban for player to true
tfm.exec.killPlayer(p); --kills player
end

function SetUp()
foreach(tfm.get.room.playerList, eventNewPlayer); -- gives all indexes from tfm.get.room.playerList (players who are on the room) to argument first of eventNewPlayer
for _, values in next, {"AfkDeath", "AutoNewGame", "AutoTimeLeft", "AutoShaman"} do
tfm.exec["disable"..values]();
end
tfm.exec.newGame(map); -- it should be a map, because if it doesn't then killing won't work
end

function eventNewPlayer(p)
ban[p] = ban[p] or false; -- creating new boolean variable in ban table for every player who joined and set it to false if it isn't exist
if(ban[p]) then
tfm.exec.killPlayer(p); -- if ban is true then kill player
else
tfm.exec.respawnPlayer(p); -- if ban is false then respawn player
end
end

function eventPlayerDied(p)
if(not(ban[p])) then -- if player isn't banned (if player's boolean ban isn't true) then respawn
tfm.exec.respawnPlayer(p);
end
end


function eventChatCommand(name,cmd)
if(cmd:sub(0,3)=="ban") then -- if from 0th character to 3rd character string is "ban" then
Example(cmd:sub(5)); -- use function Example and setting it's first argument from 5th character
end
end

SetUp();

Thanks, can you add admin system too, so it can only be used if player's name is in admin = {}?
Sebafrancuz
« Consul »
1512055560000
    • Sebafrancuz#0000
    • Profil
    • Derniers messages
    • Tribu
#2648
  0
Marciskris a dit :

Thanks, can you add admin system too, so it can only be used if player's name is in admin = {}?

I hope it's working (I didn't test it yet):
Code

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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
local admin = {"Marciskris", "Nick"} -- creates new table where admins are added
local ban = {} -- creates new table
local map = "0"

function Example(p)
ban[p] = true;
tfm.exec.killPlayer(p);
end

function isAdmin(p)
for _, values in next, admin do
if values == p then
return true; -- if one value in "admin" table is same as 1st argument in function then return true
end
end
return false; -- if the function won't find same value then return false
end

function SetUp()
foreach(tfm.get.room.playerList, eventNewPlayer);
for _, values in next, {"AfkDeath", "AutoNewGame", "AutoTimeLeft", "AutoShaman"} do
tfm.exec["disable"..values]();
end
tfm.exec.newGame(map);
end

function eventNewPlayer(p)
ban[p] = ban[p] or false;
if(ban[p]) then
tfm.exec.killPlayer(p);
else
tfm.exec.respawnPlayer(p);
end
end

function eventPlayerDied(p)
if(not(ban[p])) then
tfm.exec.respawnPlayer(p);
end
end


function eventChatCommand(name,cmd)
if(cmd:sub(0,3)=="ban" and isAdmin(name)) then -- checks is first word is "ban" and is player who used this command is admin
Example(cmd:sub(5));
end
end

SetUp();
Dramacorn
« Consul »
1512135600000
    • Dramacorn#2857
    • Profil
    • Derniers messages
    • Tribu
#2649
  0
who has the script that makes up objects, and you can set up / down
Vekout
« Citoyen »
1513065300000
    • Vekout#0000
    • Profil
    • Derniers messages
    • Tribu
#2650
  0
I need a script that shows a list where it appears the records that each player (timeElapsedSinceRespawn) and the one that achieves the best time that says: "BEST TIME!"

Please
Dad_yx
« Citoyen »
1514057400000
    • Dad_yx#3534
    • Profil
    • Derniers messages
#2651
  0
How to make transforming. I mean:


!Monster then you become monster.
Bolodefchoco
« Sénateur »
1514066220000
    • Bolodefchoco#0095
    • Profil
    • Derniers messages
    • Tribu
#2652
  0
Xymessiyx a dit :
How to make transforming. I mean:


!Monster then you become monster.

Code Lua

1
2
3
4
5
eventChatCommand = function(name, command)
if command == "Monster" then
tfm.exec.setVampirePlayer(name)
end
end
!?!
Dad_yx
« Citoyen »
1514814240000
    • Dad_yx#3534
    • Profil
    • Derniers messages
#2653
  0
Bolodefchoco a dit :
Xymessiyx a dit :
How to make transforming. I mean:


!Monster then you become monster.

Code Lua

1
2
3
4
5
eventChatCommand = function(name, command)
if command == "Monster" then
tfm.exec.setVampirePlayer(name)
end
end
!?!

Thanks! But how to make you become picture when you transform?
Onkei
« Citoyen »
1514814360000
    • Onkei#0000
    • Profil
    • Derniers messages
    • Tribu
#2654
  0
Xymessiyx a dit :
Thanks! But how to make you become picture when you transform?

Assuming you're loading your scripts in the tribe house, you can't use pictures in the tribe house.
Honorabilis
« Consul »
1514814420000
    • Honorabilis#0000
    • Profil
    • Derniers messages
    • Tribu
#2655
  0
^ already answered
Denyelxxx
« Citoyen »
1514973180000
    • Denyelxxx#0000
    • Profil
    • Derniers messages
#2656
  0
function main()
for playerName in pairs(tfm.get.room.playerList) do
eventNewPlayer(playerName)
end
end

function eventNewPlayer(playerName)
system.bindMouse (playerName, true);
end

function eventMouse (playerName, mx, my)
local size = 5;
local x_position = mx;
local y_position = my;

for t=0,2*math.pi,0.1 do

x=(16*math.sin(t)^3)*size + x_position
y=(13*math.cos(t)-5*math.cos(2*t)-2*math.cos(3*t)-math.cos(4*t))*size
y=-y + y_position

tfm.exec.addShamanObject(0,x,y);

end
end

main ();

Can you make it so i can only spawn hearts not all mice in the room?
Bolodefchoco
« Sénateur »
1514978940000
    • Bolodefchoco#0095
    • Profil
    • Derniers messages
    • Tribu
#2657
  0
Denyelxxx a dit :
function main()
for playerName in pairs(tfm.get.room.playerList) do
eventNewPlayer(playerName)
end
end

function eventNewPlayer(playerName)
system.bindMouse (playerName, true);
end

function eventMouse (playerName, mx, my)
local size = 5;
local x_position = mx;
local y_position = my;

for t=0,2*math.pi,0.1 do

x=(16*math.sin(t)^3)*size + x_position
y=(13*math.cos(t)-5*math.cos(2*t)-2*math.cos(3*t)-math.cos(4*t))*size
y=-y + y_position

tfm.exec.addShamanObject(0,x,y);

end
end

main ();

Can you make it so i can only spawn hearts not all mice in the room?

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
player = "Denyelxxx"

function eventNewPlayer(playerName)
if playerName == player then
system.bindMouse(player, true)
end
end
table.foreach(tfm.get.room.playerList, eventNewPlayer)

function eventMouse (playerName, mx, my)
local size = 5;
local x_position = mx;
local y_position = my;

for t=0,2*math.pi,0.1 do

x=(16*math.sin(t)^3)*size + x_position
y=(13*math.cos(t)-5*math.cos(2*t)-2*math.cos(3*t)-math.cos(4*t))*size
y=-y + y_position

tfm.exec.addShamanObject(0,x,y);

end
end

Make sure to use the tag

[code=Lua]
Code here
[/code]


next time xD
Denyelxxx
« Citoyen »
1515019140000
    • Denyelxxx#0000
    • Profil
    • Derniers messages
#2658
  0
Ok, thx
Erel
« Consul »
1515568080000
    • Erel#3432
    • Profil
    • Derniers messages
#2659
  4
what is this topic?
Bolodefchoco
« Sénateur »
1515612780000
    • Bolodefchoco#0095
    • Profil
    • Derniers messages
    • Tribu
#2660
  0
Pillpelet a dit :
what is this topic?

You can ask for lua scripts to use on Transformice by typing /lua
  • Forums
  • /
  • Transformice
  • /
  • Modules
  • /
  • Script Requests
« ‹ 133 / 160 › »
© Atelier801 2018

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

Version 1.27