×

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
« ‹ 136 / 160 › »
Script Requests
Overjoy06
« Citoyen »
1517214420000
    • Overjoy06#0000
    • Profil
    • Derniers messages
    • Tribu
#2701
  0
Also how do you respawn everyone even the new joiners..
Because i dont know that script..
Overjoy06
« Citoyen »
1517214600000
    • Overjoy06#0000
    • Profil
    • Derniers messages
    • Tribu
#2702
  0
is there a script like this : if i say !mapname Hello world! it will name the tribehouse's code to Hello world!

function eventChatCommand(name, cmd)
if cmd:sub(0,7) == "mapname" then
tfm.exec.newGame(cmd:sub(5))
end
end
^ is that it?
Bolodefchoco
« Sénateur »
1517237580000
    • Bolodefchoco#0095
    • Profil
    • Derniers messages
    • Tribu
#2703
  0
Overjoy06 a dit :
Also how do you respawn everyone even the new joiners..
Because i dont know that script..

Code Lua

1
2
3
4
eventNewPlayer = function(n)
tfm.exec.respawnPlayer(n)
end
table.foreach(tfm.get.room.playerList, eventNewPlayer)


Overjoy06 a dit :
is there a script like this : if i say !mapname Hello world! it will name the tribehouse's code to Hello world!

function eventChatCommand(name, cmd)
if cmd:sub(0,7) == "mapname" then
tfm.exec.newGame(cmd:sub(5))
end
end
^ is that it?

Use [code=Lua] your code [/code] to put a Lua script here.

Code Lua

1
2
3
4
5
6
7
8
function eventChatCommand(name, cmd)
-- m1 a2 p3 n4 a5 m6 e7 = 7, so (1, 7)
if cmd:sub(1,7) == "mapname" then
-- after the mapname, we have a " " (space), so it is 7 + 2 the initial text: 9
-- also the function is ui.setMapName
ui.setMapName(cmd:sub(9))
end
end
Koruto
« Citoyen »
1517470140000
    • Koruto#2851
    • Profil
    • Derniers messages
    • Tribu
#2704
  0
You see the minigame battle made by Jordynl is too interesting to play.

Can anyone give me the script of battle. I wanna try it.
Overjoy06
« Citoyen »
1517481960000
    • Overjoy06#0000
    • Profil
    • Derniers messages
    • Tribu
#2705
  0
How do you set spawn?
Bolodefchoco
« Sénateur »
1517497680000
    • Bolodefchoco#0095
    • Profil
    • Derniers messages
    • Tribu
#2706
  0
Hemant2002 a dit :
You see the minigame battle made by Jordynl is too interesting to play.

Can anyone give me the script of battle. I wanna try it.

You can play that at his room :/

Overjoy06 a dit :
How do you set spawn?

What do you mean? Respawn the player and move him?

Code Lua

1
2
3
4
eventPlayerDied = function(n)
tfm.exec.respawnPlayer(n)
tfm.exec.movePlayer(n, X_coordinate, Y_coordinate)
end
Koruto
« Citoyen »
1517540040000
    • Koruto#2851
    • Profil
    • Derniers messages
    • Tribu
#2707
  0
Bolodefchoco a dit :
You can play that at his room :/

The games not official and it isnt been run so i cant play so please ask him to give script or run the game.
Overjoy06
« Citoyen »
1517560260000
    • Overjoy06#0000
    • Profil
    • Derniers messages
    • Tribu
#2708
  0
Yes, thanks Bolodefchoco

How do you make a script doing like this :
when you click space on a player it will teleport him somewhere

and when you click on a message saying "Get meep" It gives you meep scripts..
I don't know those lua scripts

Dernière modification le 1517569380000
Overjoy06
1517561160000
    • Overjoy06#0000
    • Profil
    • Derniers messages
    • Tribu
#2709
[Modéré par Wangan, raison : Multiple posts.]
Overjoy06
1517561580000
    • Overjoy06#0000
    • Profil
    • Derniers messages
    • Tribu
#2710
[Modéré par Wangan, raison : Multiple posts.]
Acer
« Citoyen »
1517565240000
    • Acer#0095
    • Profil
    • Derniers messages
    • Tribu
#2711
  0
Overjoy06 a dit :
How do you make a script doing like this :
when you click space on a player it will teleport him somewhere

How can you click space on a player? Do you want a player to teleport anywhere on the map randomly or to a specific location? Be more specific please.

Overjoy06 a dit :
and when you click on a message saying "Get meep" It gives you meep scripts..
I don't know those lua scripts

1
2
3
4
5
6
7
ui.addTextArea(1,"<a href='event:meep'>Give Meep!</a>",nil,10,30,70,20)

function eventTextAreaCallback(textAreaID, playerName, callback)
if (callback == 'meep') then
tfm.exec.giveMeep(playerName)
end
end

This will create a button on the top-left corner of the screen, clicking it will give the player Meep ability.
Overjoy06
« Citoyen »
1517566020000
    • Overjoy06#0000
    • Profil
    • Derniers messages
    • Tribu
#2712
  0
like when you have meep it will make the player get teleported to the coordinate that is on the lua script

if you want more specific then when a player clicked space (number 32) on a player it will make them get teleported on the coordinate based on the lua script

i want them to be on a specific location sorry i am not a american..

Also, what script does this :
theres a button then when you click it something will be spawned (i need it on a specific location)

that object is a small plank

Dernière modification le 1517569320000
Overjoy06
1517566140000
    • Overjoy06#0000
    • Profil
    • Derniers messages
    • Tribu
#2713
[Modéré par Wangan, raison : Multiple posts. Please edit your posts instead of making consecutive posts.]
Overjoy06
1517566620000
    • Overjoy06#0000
    • Profil
    • Derniers messages
    • Tribu
#2714
[Modéré par Wangan, raison : Multiple posts. Please edit your posts instead of making consecutive posts.]
Overjoy06
1517568720000
    • Overjoy06#0000
    • Profil
    • Derniers messages
    • Tribu
#2715
[Modéré par Wangan, raison : Multiple posts. Please edit your posts instead of making consecutive posts.]
Overjoy06
1517568720000
    • Overjoy06#0000
    • Profil
    • Derniers messages
    • Tribu
#2716
[Modéré par Wangan, raison : Multiple posts. Please edit your posts instead of making consecutive posts.]
Acer
« Citoyen »
1517571900000
    • Acer#0095
    • Profil
    • Derniers messages
    • Tribu
#2717
  0
Okay, I'm still somewhat confused about teleporting players so maybe someone else can help you with that.

As for this,

Overjoy06 a dit :
Also, what script does this :
theres a button then when you click it something will be spawned (i need it on a specific location)

that object is a small plank

1
2
3
4
5
6
7
8
9
10
11
xPos = 300 
yPos = 300
angle = 45 -- 0 will spawn the plank flat, 90 will spawn it on it's side.

ui.addTextArea(2,"<a href='event:sPlank'>Spawn Small Plank</a>",nil,10,30,120,20)

function eventTextAreaCallback(textAreaID, playerName, callback)
if (callback == 'sPlank') then
tfm.exec.addShamanObject(3,xPos,yPos,angle,0,0,false)
end
end

You can play around with xPos and yPos values to adjust exactly where you want the small plank to spawn.

Dernière modification le 1517572080000
Syrius
« Consul »
1517572560000
    • Syrius#8114
    • Profil
    • Derniers messages
    • Tribu
#2718
  0
A script that makes certain chat commands (!mapname, !cname) only available to players in the mod = {Marciskris = true} table.
Wazt
« Citoyen »
1517574780000
    • Wazt#0000
    • Profil
    • Derniers messages
    • Tribu
#2719
  0
Marciskris a dit :
A script that makes certain chat commands (!mapname, !cname) only available to players in the mod = {Marciskris = true} table.


Code Lua

1
2
3
4
5
6
7
8
9
10
mod = {Marciskris = true, Wazt = true}

function eventChatCommand(name, cmd)
-- m1 a2 p3 n4 a5 m6 e7 = 7, so (1, 7)
if cmd:sub(1,7) == "mapname" and mod[name] then
-- after the mapname, we have a " " (space), so it is 7 + 2 the initial text: 9
-- also the function is ui.setMapName
ui.setMapName(cmd:sub(9))
end
end
Acer
« Citoyen »
1517575260000
    • Acer#0095
    • Profil
    • Derniers messages
    • Tribu
#2720
  0
Marciskris a dit :
A script that makes certain chat commands (!mapname, !cname) only available to players in the mod = {Marciskris = true} table.

There's no need to set each Moderator's name to true since anyone placed in the mod array is already considered a Moderator. Simple enclose each Moderator's name in single or double quotes and separate the names with a comma.

1
mod = {'Marciskris', 'Acermice'}

Next, you can create a simple helper function to loop through the mod array when needed.

1
2
3
4
5
6
7
8
function isMod (modArr, name)
for index, value in ipairs(modArr) do
if value == name then
return true
end
end
return false
end

Now before executing any commands intended for Moderators only, simple check If the name is in the mod array. If so, proceed with the command otherwise just ignore it.

1
2
3
4
5
6
7
8
function eventChatCommand(player, cmd)
if cmd == 'mapname' then
--check if this player is in the mod array
if isMod(mod, player) then
--proceed with the command
end
end
end


Sniped by Wazt, I like their solution!

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

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

Version 1.27