×

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
« ‹ 158 / 160 › »
Script Requests
Anonimus6666
« Citoyen »
1601722020000
    • Anonimus6666#0000
    • Profil
    • Derniers messages
    • Tribu
#3141
  0
how can i change the size of the players in the tribehouse ?
Government
« Citoyen »
1601806680000
    • Government#0962
    • Profil
    • Derniers messages
#3142
  0
Jaker a dit :
Government a dit :
Searching for a giveaway lua script .

Hey, i'm still new to lua but here you go

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
50
local giveaway = {}--will store the ones who wants to participate
local total_players = 0--will store the number of players
local players = {}
local submissions = 0--clicks
local skipped = 0--will store the ones who skip

for k in next, tfm.get.room.playerList do
total_players=total_players+1--We put the names of the people in players (table) so that we can count them
end

ui.addTextArea(1, "<a href='event:enter'>Enter giveaway</a>\n\n<a href='event:skip'>Skip</a>", player)

function didEveryoneEnter()
if #giveaway + skipped == total_players then--if the number of players = number of people who participated in the giveaway or skipped
local winner = giveaway[math.random(#giveaway)]--then pick a random one from those who participated
if winner then--if the winner isn't nil then add a text area with the winner's name (below)
ui.addTextArea(2, "<T>The winner is</T> <J>"..winner.."</J>", player, 300, 200, width, height, backgroundColor, borderColor, backgroundAlpha, fixedPos)
else ui.addTextArea(2, "<T>There is</T> <R>no winner ! :(</R>", player, 300, 200, width, height, backgroundColor, borderColor, backgroundAlpha, fixedPos)--else (if winner = nil, so if everyone skipped), add a text area with no winner name
end
end
end

function checksub()
if submissions == total_players then
for name,number in next, players do
if number == 1 then
giveaway[#giveaway+1]=name
didEveryoneEnter()
end
end
end
end


function eventTextAreaCallback(id, name, event)
if event == "enter" then
if not players[name] then
submissions = submissions+1
players[name] = 1
ui.updateTextArea(1, "<G>Enter giveaway</G>\n\n<G>Skip</G>", player)
end
elseif event == "skip" then
if not players[name] then
submissions = submissions+1
players[name]=2
ui.updateTextArea(1, "<G>Enter giveaway</G>\n\n<G>Skip</G>", player)
end
end
checksub()
end

Thanks noob Athesdrake#0000 for helping me fixing it.

Thank u so much for the script .
Perfecteca
« Sénateur »
1601830860000
    • Perfecteca#0000
    • Profil
    • Derniers messages
    • Tribu
#3143
  0
Anonimus6666 a dit :
how can i change the size of the players in the tribehouse ?

tfm.exec.changePlayerSize("Anonimus6666#0000",5)
argument 2 is allowed from 0.1 to 5
Anonimus6666
« Citoyen »
1602348120000
    • Anonimus6666#0000
    • Profil
    • Derniers messages
    • Tribu
#3144
  0
how can i make this script to work for all players from the tribehouse ?
function eventNewPlayer(name)
tfm.exec.bindKeyboard(name,32,true,true)
tfm.exec.bindKeyboard(name,75,true,true)

end

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

function eventKeyboard(name,key,down,x,y)
if key==32 then
tfm.exec.changePlayerSize("Aassasinul666#1894",5)
elseif key==75 then
tfm.exec.changePlayerSize("Aassasinul666#1894",1)
end
end
Boxofkrain
« Censeur »
1602353220000
    • Boxofkrain#0000
    • Profil
    • Derniers messages
    • Tribu
#3145
  1
Anonimus6666 a dit :
how can i make this script to work for all players from the tribehouse ?
function eventNewPlayer(name)
tfm.exec.bindKeyboard(name,32,true,true)
tfm.exec.bindKeyboard(name,75,true,true)

end

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

function eventKeyboard(name,key,down,x,y)
if key==32 then
tfm.exec.changePlayerSize("Aassasinul666#1894",5)
elseif key==75 then
tfm.exec.changePlayerSize("Aassasinul666#1894",1)
end
end

Code Lua

1
2
3
for n in next, tfm.get.room.playerList do
tfm.exec.changePlayerSize(n,5)
end

The code above changes everyone's size to 5.
Perfecteca
« Sénateur »
1602356040000
    • Perfecteca#0000
    • Profil
    • Derniers messages
    • Tribu
#3146
  0
Anonimus6666 a dit :
how can i make this script to work for all players from the tribehouse ?
function eventNewPlayer(name)
tfm.exec.bindKeyboard(name,32,true,true)
tfm.exec.bindKeyboard(name,75,true,true)

end

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

function eventKeyboard(name,key,down,x,y)
if key==32 then
tfm.exec.changePlayerSize("Aassasinul666#1894",5)
elseif key==75 then
tfm.exec.changePlayerSize("Aassasinul666#1894",1)
end
end

replace "Aassasinul666#1894" with name
Eremia
« Censeur »
1604761800000
    • Eremia#0020
    • Profil
    • Derniers messages
    • Tribu
#3147
  0
How to make players move like in the Flappy mouse map and how to diasble movement overall?
Xxthomatexx
« Consul »
1605982320000
    • Xxthomatexx#0000
    • Profil
    • Derniers messages
    • Tribu
#3148
  0
Hi,
How do you transform a variable of type integer/boolean/float into a string ?
Syrius
« Consul »
1605983580000
    • Syrius#8114
    • Profil
    • Derniers messages
    • Tribu
#3149
  2
Code Lua

1
tostring(variableNameHere)
Xxthomatexx
« Consul »
1605984060000
    • Xxthomatexx#0000
    • Profil
    • Derniers messages
    • Tribu
#3150
  0
Syrius a dit :
[code = lua] tostring (variableNameHere) [/ code]


Thank you so much !
Boxofkrain
« Censeur »
1606390980000
    • Boxofkrain#0000
    • Profil
    • Derniers messages
    • Tribu
#3151
  0
Xxthomatexx a dit :
Syrius a dit :
[code = lua] tostring (variableNameHere) [/ code]


Thank you so much !

There are no floats in Lua!!!
Factral
« Citoyen »
1607294280000
    • Factral#0000
    • Profil
    • Derniers messages
    • Tribu
#3152
  0
a script to crash the game to a person?
Perfecteca
« Sénateur »
1607345400000
    • Perfecteca#0000
    • Profil
    • Derniers messages
    • Tribu
#3153
  0
Factral a dit :
a script to crash the game to a person?

Intentional crashes are against rules, instead, if you want to troll people, you may use text areas to block players from seeing the map
Yuten
« Citoyen »
1607585700000
    • Yuten#1921
    • Profil
    • Derniers messages
    • Tribu
#3154
  0
need a checkpoint script please
Hufdasr
« Citoyen »
1609072620000
    • Hufdasr#0000
    • Profil
    • Derniers messages
    • Tribu
#3155
  0
Hello, please can someone explain how os.time works? I think it was important part of LUA, but I still don´t know how it works. I want to make particle effect, which gradually and quickly appears and then disappears.
Bolodefchoco
« Sénateur »
1609074240000
    • Bolodefchoco#0095
    • Profil
    • Derniers messages
    • Tribu
#3156
  0
Hufdasr a dit :
Hello, please can someone explain how os.time works? I think it was important part of LUA, but I still don´t know how it works. I want to make particle effect, which gradually and quickly appears and then disappears.

os.time returns the current time in miliseconds since January 1st 1970

it's decent if you want to check if some time has passed since a specific action. For example, if you want to tell the user they can't press space before 5 seconds since the last press:
Code Lua

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
nextPress = 0

system.bindKeyboard('Player', 32, true, true)

eventKeyboard = function(player, key)
if key == 32 then
local time = os.time()

if time > nextPress then
print("You pressed the spacebar.")
nextPress = time + 5000
else
print("You can only press spacebar once every 5 seconds. " .. ((nextPress-time)/1000) .. " seconds left.")
end
end
end


You'll need to use eventLoop for the particles thing.

Code Lua

1
2
3
4
5
6
local particleX = 40
eventLoop = function() -- triggered twice per second
particleX = (particleX + 80) % 800

tfm.exec.displayParticle(9, particleX, 200)
end

Dernière modification le 1609074300000
Hufdasr
« Citoyen »
1609079880000
    • Hufdasr#0000
    • Profil
    • Derniers messages
    • Tribu
#3157
  0
Thank you!
Shadow
« Citoyen »
1614341040000
    • Shadow#5397
    • Profil
    • Derniers messages
    • Tribu
#3158
  0
Know someone how to reload every images when new player join room?
I did my first script with new image function but if someone join room, he cant see already existing images on other players.
Perfecteca
« Sénateur »
1614513240000
    • Perfecteca#0000
    • Profil
    • Derniers messages
    • Tribu
#3159
  0
Shadow a dit :
Know someone how to reload every images when new player join room?
I did my first script with new image function but if someone join room, he cant see already existing images on other players.

use this:

Code Lua

1
2
3
function eventNewPlayer(player)
tfm.exec.addImage("imageID","target",x,y,player)
end

or you may use nil instead of player so whenever a player joins the room, the image will be updated for everyone in the room
Missdilan
« Citoyen »
1615540200000
    • Missdilan#3234
    • Profil
    • Derniers messages
#3160
  0
I need ice plank and ice cube but I can't find the picture. Can you help me?
  • Forums
  • /
  • Transformice
  • /
  • Modules
  • /
  • Script Requests
« ‹ 158 / 160 › »
© Atelier801 2018

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

Version 1.27