×

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
« ‹ 150 / 160 › »
Script Requests
Overjoy06
« Citoyen »
1537157700000
    • Overjoy06#0000
    • Profil
    • Derniers messages
    • Tribu
#2981
  0
can someone tell me how the "function PopupAnswer" works?

dont tell anything about my profile picture

Dernière modification le 1537157760000
Sebafrancuz
« Consul »
1537191060000
    • Sebafrancuz#0000
    • Profil
    • Derniers messages
    • Tribu
#2982
  1
To get a "reaction" from eventPopupAnswer you have to use:
ui.addPopup(id, type, text, targetPlayer, x, y, width, fixedPos) , if any player uses it then magic comes to eventPopupAnswer

eventPopupAnswer(popupId, playerName, answer)
As you can see, there are 3 arguments:

- popupId (int) is an id which you used for ui.addPopup
- playerName (string) is a player who used ui.addPopup (inserted text for type = 2, or clicked "yes" / "no" for type = 1)
- answer (string) gives text which player clicked (type = 1, returns "yes" or "no") or inserted (type = 2, returns text inserted by player)

btw nice pfp, but I don't want you

Dernière modification le 1537191240000
Campwolf
« Citoyen »
1538099340000
    • Campwolf#8695
    • Profil
    • Derniers messages
    • Tribu
#2983
  0
I've been trying to make Mousenite.
So it works like.

It's going to be a team death-match. Where each player gets health and they can shoot cannons. Once you get hit by a cannon it dissapears but you lose health on how close the cannon was hit. Then if the player dies you get a kill. At the end when everyone dies they show the leaderboard with your amount of kills for each person. This would help me a lot in my adventure.
Sebafrancuz
« Consul »
1538141400000
    • Sebafrancuz#0000
    • Profil
    • Derniers messages
    • Tribu
#2984
  1
Campwolf a dit :
I've been trying to make Mousenite.
So it works like.

It's going to be a team death-match. Where each player gets health and they can shoot cannons. Once you get hit by a cannon it dissapears but you lose health on how close the cannon was hit. Then if the player dies you get a kill. At the end when everyone dies they show the leaderboard with your amount of kills for each person. This would help me a lot in my adventure.

Loops which exist in Module API are so slow to make things like that, you can make some calculations, but it won't work as it should.

Dernière modification le 1538141520000
Themiachale
« Citoyen »
1539355920000
    • Themiachale#0000
    • Profil
    • Derniers messages
    • Tribu
#2985
  0
Hi, I need some help for a tribe event my tribe is planning, it's an hard request, I know..., hope someone can help me with it, we'll need it before Halloween. If not possible thanks anyway and sorry if my English is too bad.

The event we are planning is "Town of Salem" but recalled by the name of our italian tribe (Green Wolves) "Orrore a Green Town" (Horror in Green Town).
Some things are in italian, like the name of the roles and the phases of the day.


I need a lua script for the game that have these things:

1) A time popup.
2) Commands.
3) A point tab modified
4) A "Morto" role
5) A "Sceriffo" role
6) A "Sindaco" role
7) Infinite map time with map made by myself (but I can do this by myself)


1) A time popup with name of the current phase, in the top right corner, of these phases:

"Giorno" (Day time)

"Discussione" 3 minutes for discuss
"Votazione" 1 minute for a votation
"Processo" 30 seconds for killing the one with more votes
"Pensieri" 1 minute for discuss

"Notte" (Night time)

"Riposo" 2 minutes for the guards and the assassins to kill or protect people

example.
| "Giorno" |
| "Discussione" |
| "68s" |
or
| "Notte" |
| "Riposo" |
| "23s" |

the time is: "time left to change phase"

the phases are:

During Day ("Giorno")

"Discussione" 180s
"Votazione" 60s
"Processo" 30s
"Pensieri" 60s

During Night ("Notte")

"Riposo" 120s

2) Few commands:

!tp . command for only admin. tp with a click of the mouse
!vote (nick) . for voting the player you want to kill during the votation phase and only one per person for day (need to show the points on the point tab) (not usable for the ones who are "Morto" and for the admin)
!morto (nick) . command only for admin. gives a player the role "Morto" and move it to the top of the map (can't use "!vote (nick)" command)
!sceriffo (nick) . command only for admin. gives a player the role "Sceriffo" (his vote count as 3)
!sindaco (nick) . command only for admin. gives a player the role "Sindaco" (his vote count as 2)
!newgame . command only for admin. when a game is done and a side won, the admin types this command and everything got resetted and the people in the "Morto", "Sceriffo" and "Sindaco" role gets back to normal

3) The modified point tab
I need that someone gets some points on the point tab, respecting the roles abilities, for getting a vote by the command "!vote (nick)" and at the end of the cycle of the day the point tab gets resetted

4) The "Morto" role
a role where you can't use the command "!vote (nick)" but you can only watch the rest of the game from the top of the map..show them with a dark blue nick (if possible)

5) The "Sceriffo" role
a role assigned by the admin, his vote count as 3 in the point tab. no need to show who he is

6) The "Sindaco" role
a role assigned by the admin, his vote count as 2 in the point tab. no need to show who he is
Ace
« Consul »
1539364380000
    • Ace#1270
    • Profil
    • Derniers messages
#2986
  0
Can I make the shaman invisible?
Bolodefchoco
« Sénateur »
1539381120000
    • Bolodefchoco#0095
    • Profil
    • Derniers messages
    • Tribu
#2987
  0
Syc a dit :
Can I make the shaman invisible?

yes, by linking an image in the shaman. tfm.exec.newGame("", "%Shaman", 0, 0), but it won't work in tribe houses :/
Myth
« Citoyen »
1539410640000
    • Myth#1161
    • Profil
    • Derniers messages
    • Tribu
#2988
  0
Hi, please help!!

I have this:


mice = {}

function main()
tfm.exec.setGameTime(20)
for name in pairs(tfm.get.room.playerList) do
eventNewPlayer(name)
end
end

function eventNewPlayer(name)

mice[name] = {
points = 0,
}

end

function eventPlayerWon(name)
mice[name].points = mice[name].points + 1
end

function eventLoop(t,tr)
if tr <=5000 then
for name in pairs(tfm.get.room.playerList) do
t = ""..name.." "..mice[name].points.." \n"
ui.addTextArea(0,""..t.."", nil, 89, 82, 535, 210, 0x324650, 0x000000, 1, true)
print(t)
end
end
end

main()

----------------------

if i put: print(t)
looks like:



• # [*Tribui] Myth#1161 1

• # [*Tribui] Noorks#0000 3

• # [*Tribui] Mirkko#1908 0


but in the textArea i can only see one player, like:
Myth#1161 1

I need to see in the textArea the same as in the print(), please:(
Sebafrancuz
« Consul »
1539423480000
    • Sebafrancuz#0000
    • Profil
    • Derniers messages
    • Tribu
#2989
  0
Myth a dit :
Hi, please help!!

I have this:


mice = {}

function main()
tfm.exec.setGameTime(20)
for name in pairs(tfm.get.room.playerList) do
eventNewPlayer(name)
end
end

function eventNewPlayer(name)

mice[name] = {
points = 0,
}

end

function eventPlayerWon(name)
mice[name].points = mice[name].points + 1
end

function eventLoop(t,tr)
if tr <=5000 then
for name in pairs(tfm.get.room.playerList) do
t = ""..name.." "..mice[name].points.." \n"
ui.addTextArea(0,""..t.."", nil, 89, 82, 535, 210, 0x324650, 0x000000, 1, true)
print(t)
end
end
end

main()

----------------------

if i put: print(t)
looks like:



• # [*Tribui] Myth#1161 1

• # [*Tribui] Noorks#0000 3

• # [*Tribui] Mirkko#1908 0


but in the textArea i can only see one player, like:
Myth#1161 1

I need to see in the textArea the same as in the print(), please:(


You changed value of variable "t" to the newest value
You should make something like this:
Code Lua

1
2
3
4
5
6
7
8
9
10
function eventLoop(t,tr)
if tr <=5000 then
local t = ""
for name in pairs(tfm.get.room.playerList) do
t = t..name.." "..mice[name].points.." \n"
ui.addTextArea(0,""..t.."", nil, 89, 82, 535, 210, 0x324650, 0x000000, 1, true)
print(t)
end
end
end

I just made t = t.. "new text" which gets old value and adds new value to a string
It's something like
local a = "a"
local b = "b"
local c = a..b -- which makes "ab"
c = c..a -- would make "ab".."a" = "aba"

Dernière modification le 1539423840000
Myth
« Citoyen »
1539457080000
    • Myth#1161
    • Profil
    • Derniers messages
    • Tribu
#2990
  0
Sebafrancuz a dit :
Myth a dit :
Hi, please help!!

I have this:


mice = {}

function main()
tfm.exec.setGameTime(20)
for name in pairs(tfm.get.room.playerList) do
eventNewPlayer(name)
end
end

function eventNewPlayer(name)

mice[name] = {
points = 0,
}

end

function eventPlayerWon(name)
mice[name].points = mice[name].points + 1
end

function eventLoop(t,tr)
if tr <=5000 then
for name in pairs(tfm.get.room.playerList) do
t = ""..name.." "..mice[name].points.." \n"
ui.addTextArea(0,""..t.."", nil, 89, 82, 535, 210, 0x324650, 0x000000, 1, true)
print(t)
end
end
end

main()

----------------------

if i put: print(t)
looks like:



• # [*Tribui] Myth#1161 1

• # [*Tribui] Noorks#0000 3

• # [*Tribui] Mirkko#1908 0


but in the textArea i can only see one player, like:
Myth#1161 1

I need to see in the textArea the same as in the print(), please:(


You changed value of variable "t" to the newest value
You should make something like this:
Code Lua

1
2
3
4
5
6
7
8
9
10
function eventLoop(t,tr)
if tr <=5000 then
local t = ""
for name in pairs(tfm.get.room.playerList) do
t = t..name.." "..mice[name].points.." \n"
ui.addTextArea(0,""..t.."", nil, 89, 82, 535, 210, 0x324650, 0x000000, 1, true)
print(t)
end
end
end

I just made t = t.. "new text" which gets old value and adds new value to a string
It's something like
local a = "a"
local b = "b"
local c = a..b -- which makes "ab"
c = c..a -- would make "ab".."a" = "aba"

Thanks you so much :)
Ozan
« Citoyen »
1539502860000
    • Ozan#2513
    • Profil
    • Derniers messages
#2991
  0
How can i remove, saved playerData ?
Bolodefchoco
« Sénateur »
1539520620000
    • Bolodefchoco#0095
    • Profil
    • Derniers messages
    • Tribu
#2992
  0
Ozan a dit :
How can i remove, saved playerData ?

In system.savePlayerData? Save an empty string ""
Ozan
« Citoyen »
1539532200000
    • Ozan#2513
    • Profil
    • Derniers messages
#2993
  0
Bolodefchoco a dit :
Ozan a dit :
How can i remove, saved playerData ?

In system.savePlayerData? Save an empty string ""

For example, in a map, i saved a player record. And i want to remove now this record. How can i do this
Bolodefchoco
« Sénateur »
1539537300000
    • Bolodefchoco#0095
    • Profil
    • Derniers messages
    • Tribu
#2994
  0
Ozan a dit :
Bolodefchoco a dit :
Ozan a dit :
How can i remove, saved playerData ?

In system.savePlayerData? Save an empty string ""

For example, in a map, i saved a player record. And i want to remove now this record. How can i do this

depends on how you save it lol
Mutluerkek
« Citoyen »
1539609180000
    • Mutluerkek#8315
    • Profil
    • Derniers messages
    • Tribu
#2995
  0
Bolodefchoco a dit :
Ozan a dit :
Bolodefchoco a dit :
Ozan a dit :
How can i remove, saved playerData ?

In system.savePlayerData? Save an empty string ""

For example, in a map, i saved a player record. And i want to remove now this record. How can i do this

depends on how you save it lol

in a pvp server :/
Overjoy06
« Citoyen »
1539854400000
    • Overjoy06#0000
    • Profil
    • Derniers messages
    • Tribu
#2996
  0
Is it possible to make two people become soulmates (the chain)
But if you click a textarea it would make them free

(Sorry for bad grammar)
Sebafrancuz
« Consul »
1539876180000
    • Sebafrancuz#0000
    • Profil
    • Derniers messages
    • Tribu
#2997
  1
Overjoy06 a dit :
Is it possible to make two people become soulmates (the chain)
But if you click a textarea it would make them free

(Sorry for bad grammar)

Code Lua

1
2
3
4
5
6
7
8
9
10
11
12
local player1 = "" -- player to be linked with player2
local player2 = "" -- player to be linked with player1

tfm.exec.linkMice(player1, player2, true)

ui.addTextArea(1, "<a href='event:nomore'>Unlink</a>", "Overjoy06#0000", 5, 30, nil, nil, 0x000000, 0xffffff, 0.5, true)

eventTextAreaCallback = function(id, player, answer)
if answer == "nomore" then
tfm.exec.linkMice(player1, player2, false)
end
end
Plasteroti
« Citoyen »
1539921420000
    • Plasteroti#0000
    • Profil
    • Derniers messages
#2998
  0
Hello! somebody can help me? I need several things:

1- Three textAreas

TextArea1: button to make teams (two or more player in different teams, but always paired, 2v2,4v4,4v3 you know...)
TextArea2: player list of Team 1
TextArea3: player list of Team 2

2- A command to manually add players to some team (!team1 player1#0000) (!team2 player2#0000)

I hope someone helps me, thanks!
Meeddal
« Citoyen »
1540017720000
    • Meeddal#0000
    • Profil
    • Derniers messages
#2999
  0
Hello what i must write to take transformation from all players?

tfm.exec.giveTransformations (playerName,canTransform)
Hypermousem
« Censeur »
1540024200000
    • Hypermousem#0000
    • Profil
    • Derniers messages
    • Tribu
#3000
  0
Meeddal a dit :
Hello what i must write to take transformation from all players?

tfm.exec.giveTransformations (playerName,canTransform)

Here's a slightly clearer explanation. This person and I are working on a script or our tribe and two functions don't seem to work for everyone in the room - namely tm.exec.giveMeep and tfm.exec.giveTransformations. I tried doing it like this:
Code Lua

1
2
tfm.exec.giveMeep(tfm.get.room.playerList[nil],true)
tfm.exec.giveTransformations(tfm.get.room.playerList[nil],true)
But it results in this:
• [10:26] # [*Kompania X] tfm.exec.giveMeep : argument 1 can't be NIL.
• [10:26] # [*Kompania X] tfm.exec.giveTransformations : argument 1 can't be NIL.
Are there any ways to make these functions work for every player in the room, or are they just made that way so that they can't be used for everyone?

EDIT: seems like I found a solution already.

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

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

Version 1.27