×

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
« ‹ 128 / 160 › »
Script Requests
Dad_yx
1491731700000
    • Dad_yx#3534
    • Profil
    • Derniers messages
#2541
[Modéré par Shamousey, raison : Quadruple post. You were already asked not to post multiple times in a row, please edit your previous post and give more information about the issues you are encountering.]
Sebafrancuz
« Consul »
1491733680000
    • Sebafrancuz#0000
    • Profil
    • Derniers messages
    • Tribu
#2542
  1
Xymessiyx a dit :
help me

1.script isnt work
2.so much errors

Which script?
Loghorizonph
« Citoyen »
1491821040000
    • Loghorizonph#0000
    • Profil
    • Derniers messages
    • Tribu
#2543
  0
Hello Anyone help me how to make a map when mice press S or down arrown it spawn snowball or cannon

Dernière modification le 1491821700000
Heniyengui
« Citoyen »
1491844860000
    • Heniyengui#0000
    • Profil
    • Derniers messages
#2544
  0
How to unshaman someone. I used tfm.exec.setShaman(player) and I want to make the player not shaman without starting a new game. I tried killing then respawing but the player is still shaman. I hope someone can help.
Onkei
« Citoyen »
1491849360000
    • Onkei#0000
    • Profil
    • Derniers messages
    • Tribu
#2545
  0
Loghorizonph a dit :
Hello Anyone help me how to make a map when mice press S or down arrown it spawn snowball or cannon

To change what you spawn, press spacebar.


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
local players = {}
local keys = {space = 32, down = 40, s = 83}

function eventNewPlayer(n)
tfm.exec.bindKeyboard(n, keys.space, true, true)
tfm.exec.bindKeyboard(n, keys.down, true, true)
tfm.exec.bindKeyboard(n, keys.s, true, true)

if not players[n] then
players[n] = {snowballs = false}
end
end

function eventKeyboard(n, key, down, x, y)
local data = tfm.get.room.playerList[n]

if key == keys.down or key == keys.s then
local direction = data.isFacingRight and 1 or -1
tfm.exec.addShamanObject(players[n].snowballs and 34 or 17, x + 20 * direction, y - 25, 90 * direction, 10 * direction, -3, false)
elseif key == keys.space then
players[n].snowballs = not players[n].snowballs
end
end

table.foreach(tfm.get.room.playerList, eventNewPlayer)


Alternatively, you could follow Shamo's tutorial to learn how to do it yourself.

Heniyengui a dit :
How to unshaman someone. I used tfm.exec.setShaman(player) and I want to make the player not shaman without starting a new game. I tried killing then respawing but the player is still shaman. I hope someone can help.

rip I don't think it's possible to properly unshaman someone without starting a new game.
Dad_yx
« Citoyen »
1492019160000
    • Dad_yx#3534
    • Profil
    • Derniers messages
#2546
  0
Sebafrancuz a dit :
Xymessiyx a dit :
help me

1.script isnt work
2.so much errors

Which script?

by onkei its request me,its to loot errors
Ticktoxic
« Citoyen »
1492123680000
    • Ticktoxic#0930
    • Profil
    • Derniers messages
    • Tribu
#2547
  0
I was thinking of this:
Cheese war thing.
Someone is chosen to get cheese ( randomly ) and has to run from the other mice and get to the hole. The one with the cheese starts in a separate place. If a mouse catches them, they must run with the cheese. The first mouse to the hole wins.
Is that to much?
Noonicknames
« Citoyen »
1492176660000
    • Noonicknames#0000
    • Profil
    • Derniers messages
    • Tribu
#2548
  0
What is the script for FFA in utility. You say !ffa and when you duck you will spawn a cannon and it is just under your mouse so you can cannonjump. Please provide a script.

Edit: Can you add comments to explain how the script works because i'm not that good at lua.

Dernière modification le 1492676040000
Sebafrancuz
« Consul »
1492183560000
    • Sebafrancuz#0000
    • Profil
    • Derniers messages
    • Tribu
#2549
  1
Noonicknames a dit :
What is the script for FFA in utility. You say !ffa and when you duck you will spawn a cannon and it is just under your mouse so you can cannonjump. Please provide a script.

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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
_S = {}

KEYS = {
["DOWN"] = 3,
}

_S.ffa = {
toDespawn={},
}

function main()
table.foreach(tfm["get"]["room"]["playerList"], eventNewPlayer)
end

function eventNewPlayer(p)
system.bindKeyboard(p, KEYS["DOWN"], true, true)
_S["ffa"][p] = {
activeSegments = {
["ffa"]=false,
},
ffa={
object=17,
power=10,
timestamp=0,
cooldown=1000,
spawnLength=2000,
offset={
x=2,
y=10,
},
},
}
end

function eventChatCommand(p, k)
local args = {}
for i in k:gmatch("%S+") do
table.insert(args, i)
end
if args[1] == "ffa" then
if args[2] then
if tfm["get"]["room"]["playerList"][args[2]] then
_S["ffa"][args[2]]["activeSegments"]["ffa"] = not(_S["ffa"][args[2]]["activeSegments"]["ffa"])
elseif args[2] == "all" then
for players in next, tfm["get"]["room"]["playerList"] do
_S["ffa"][players]["activeSegments"]["ffa"] = not(_S["ffa"][players]["activeSegments"]["ffa"])
end
end
else
_S["ffa"][p]["activeSegments"]["ffa"] = not(_S["ffa"][p]["activeSegments"]["ffa"])
end
elseif args[1] == "offset" then
local newx,newy
if tonumber(args[2]) and tonumber(args[3]) then
newx=args[2]
newy=args[3]
elseif args[2]=="dom" then
newx=-10
newy=15
elseif args[2]=="def" then
newx=2
newy=10
end
if newx and newy then
_S["ffa"][p]["ffa"]["offset"]={x=tonumber(newx),y=tonumber(newy)}
end
end
end

function eventKeyboard(p, k, d, x, y)
if k == KEYS["DOWN"] then
local player = _S["ffa"][p]
if d and not tfm.get.room.playerList[p].isDead and player["activeSegments"]["ffa"] then
if player.ffa.timestamp<=os.time()-player.ffa.cooldown then
local angle=(tfm["get"]["room"]["playerList"][p].isFacingRight and 90 or 270)+(player.ffa.object==17 and 0 or -90)
table.insert(_S.ffa.toDespawn,{
id=tfm.exec.addShamanObject(17, tfm["get"]["room"]["playerList"][p].isFacingRight and x+player.ffa.offset.x or x-player.ffa.offset.x,y+player.ffa.offset.y,angle,player.ffa.power*math.cos(math.rad(angle)),player.ffa.power*math.sin(math.rad(angle))),
despawn=os.time()+player.ffa.spawnLength
})
player.ffa.timestamp=os.time()
end
end
end
end

function eventLoop()
for i, v in next, _S.ffa.toDespawn do
if v.despawn <= os.time() then
tfm.exec.removeObject(v.id)
end
end
end

main()

I hope all working fine, some things from:
Official script: https://github.com/ImLiam/Transformice-Utility/blob/master/src/segments/ffa.lua


Ouch I've forgotten, you've made tutorial. v

Dernière modification le 1492189680000
Shamousey
« Consul »
1492186680000
    • Shamousey#0095
    • Profil
    • Derniers messages
    • Tribu
#2550
  0
Noonicknames a dit :
What is the script for FFA in utility. You say !ffa and when you duck you will spawn a cannon and it is just under your mouse so you can cannonjump. Please provide a script.

If you'd like a more standalone option, there's a tutorial on how to create it here.
Dagaker
« Censeur »
1492349340000
    • Dagaker#3257
    • Profil
    • Derniers messages
#2551
  0

I need a script that will allow me to spawn these:

http://images.atelier801.com/15b66e9717c.png - 1

http://images.atelier801.com/15b66e73aae.png -2

http://images.atelier801.com/15b66ea26ae.png -3

http://images.atelier801.com/15b66e7fde7.png -4

http://images.atelier801.com/15b66e7a341.png -5

http://images.atelier801.com/15b66e6f428.png -6


There should be like options with numbers to choose wich i want to spawn so i added the numbers next to them, and than when i click on anything it should spawn there where i clicked.

Idk if this possible but please find anyone who can make this type of script!


Dernière modification le 1492349520000
Turce1st
« Censeur »
1492362480000
    • Turce1st#4618
    • Profil
    • Derniers messages
#2552
  1
you can"t add this in script
Sebafrancuz
« Consul »
1492364040000
    • Sebafrancuz#0000
    • Profil
    • Derniers messages
    • Tribu
#2553
  2
Tukushii a dit :

I need a script that will allow me to spawn these:

http://images.atelier801.com/15b66e9717c.png - 1

http://images.atelier801.com/15b66e73aae.png -2

http://images.atelier801.com/15b66ea26ae.png -3

http://images.atelier801.com/15b66e7fde7.png -4

http://images.atelier801.com/15b66e7a341.png -5

http://images.atelier801.com/15b66e6f428.png -6


There should be like options with numbers to choose wich i want to spawn so i added the numbers next to them, and than when i click on anything it should spawn there where i clicked.

Idk if this possible but please find anyone who can make this type of script!


It's an event, You couldn't copy values from the event... Only you can create simulation of this event, but only with Module Team Member's functions.

Dernière modification le 1492383900000
Dramacorn
« Consul »
1493049060000
    • Dramacorn#2857
    • Profil
    • Derniers messages
    • Tribu
#2554
  0
I need a script in which you can vote, and when someone has a lot of votes to pop up a text with "x was guilty,
Loghorizonph
« Citoyen »
1493421600000
    • Loghorizonph#0000
    • Profil
    • Derniers messages
    • Tribu
#2555
  0
I need script

Having shop list in tribehouse
Regenating coins +2 per second

Shoplist
~Meep (reset meep when die)
~Cannon (3 cannons per buy)
~snowball (3 snowball per buy)
Dad_yx
« Citoyen »
1493488500000
    • Dad_yx#3534
    • Profil
    • Derniers messages
#2556
  0
i need script (maybe i get hack ban but one of my friends can type)

1.ballon flying around map
2.if mice touch ballon then is dead
3.round have only 30 seconds
4.mice teleported to lobby (whatever map is lobby) only 15 seconds
5.description for lobby (lobby is just map)


edit:mice spawn at lobby then when 15 seconds countdown is teleport to main map for my minigame (i choose)

edit 2:when one ballon spawn and for 2 second will spawn new,and when all mice dead then teleport to lobby



edit 3:i dont wanna wait 100 days please type it now

Dernière modification le 1493565600000
Perfecteca
« Sénateur »
1493595120000
    • Perfecteca#0000
    • Profil
    • Derniers messages
    • Tribu
#2557
  1
Can someone give an understandable code that I can write commands like !kill [Player]?
Onkei
« Citoyen »
1493636460000
    • Onkei#0000
    • Profil
    • Derniers messages
    • Tribu
#2558
  0
  • Dramatotala
  • Perfecteca
Things to note with the below code is that the poll only finishes if the number of votes is equal to the number of voters. Enable debug to see who voted for who.


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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
-- Is everyone voting? Or just those in the voters table?
local everyone = true
local voters = {"Dramatotala"}

local debug = false

local currentPoll = {}
local guiltVote = {}
local Poll = {}

function Poll:new(pollText, voters)
local self = {}

self.votes = {}

self.pollText = pollText
self.voters = voters or nil

self.numberOfVoters = 0
self.numberOfVoted = 0

function self:start()
if self.voters == nil then
for n in pairs(tfm.get.room.playerList) do
self.numberOfVoters = self.numberOfVoters + 1
end
self:show(nil)
else
for i, n in pairs(voters) do
self.numberOfVoters = self.numberOfVoters + 1
self:show(n)
end
end
end

function self:show(n, err)
ui.addPopup(1, 2, self.pollText .. "<br><br>" .. (err and "Invalid input." or ""), n, 0, 20, 200, true)
end

function self:getVote(n, answer)
local playerFound = false
for n in pairs(tfm.get.room.playerList) do
if n == answer then playerFound = true end
end

-- If player voted exists in the room.
if playerFound then
if self.votes[answer] then
self.votes[answer] = self.votes[answer] + 1
else
self.votes[answer] = 1
end
if debug then
print(n .. " voted for " .. answer .. ". S/he now has " .. self.votes[answer] .. " vote(s).")
end
self.numberOfVoted = self.numberOfVoted + 1
else
self:show(n, true)
end
end

function self:finished()
return self.numberOfVoters == self.numberOfVoted
end

function self:getResult()
local votedOff = ""

for n, votes in pairs(self.votes) do
if votedOff == "" then votedOff = n end
if votes >= self.votes[votedOff] then
votedOff = n
end
end
-- Modify the code below if you want to change what the results screen is.
ui.addPopup(1, 0, votedOff .. " has been voted off!", nil, 0, 20, 200, true)
end

return self
end

function eventPopupAnswer(id, n, answer)
currentPoll:getVote(n, answer)

if currentPoll:finished() then
currentPoll:getResult()
end
end

guiltVote = Poll:new("Who would you like to vote for?", not everyone and voters or false)
guiltVote:start()
currentPoll = guiltVote


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
--[[
The eventChatCommand event gets called everytime someone types in
![command].

The eventChatCommand gives us access to two arguments, the parameters we get
is the name of the player (1) that executed the command, and the command name (2).
]]

function eventChatCommand(name, command)
--[[
string.sub() is a native Lua function that allows us to get a selected amount
of characters from a string, in this case; the first four characters
of the command entered.

If the first four characters is equal to "kill", then execute the following
line of code.
]]
if command:sub(1, 4) == "kill" then
--[[
Store the person selected into a variable, no need to do this.
command:sub(6) means that we're getting the rest of the string / command
entered after the first 5 characters.
]]
local toDie = command:sub(6)
--[[
tfm.exec.killPlayer is a TFM function that allows us to kill the player
with the name entered.
]]
tfm.exec.killPlayer(toDie)
end
end

Without comments;


Code Lua

1
2
3
4
5
6
function eventChatCommand(name, command)
if command:sub(1, 4) == "kill" then
local toDie = command:sub(6)
tfm.exec.killPlayer(toDie)
end
end


Here's an example on how to make other commands; If you want to create a command that respawns a selected player for example, you can use the tfm.exec.respawnPlayer function from the TFM API. To actually make it work with by calling !respawn [name], here's a simple tutorial following the code I used above.

1) First, check if the first command entered is equal to respawn.


Code Lua

1
2
3
4
5
6
7
8
function eventChatCommand(name, command)
if command:sub(1, 4) == "kill" then
local toDie = command:sub(6)
tfm.exec.killPlayer(toDie)
elseif command:sub(1, 7) == "respawn" then
-- We're checking for 7 characters since 'respawn' has 7 characters.
end
end


2) Similarly to the !kill [name] command, we get the name of the player into a variable.


Code Lua

1
2
3
4
5
6
7
8
9
10
11
12
function eventChatCommand(name, command)
if command:sub(1, 4) == "kill" then
local toDie = command:sub(6)
tfm.exec.killPlayer(toDie)
elseif command:sub(1, 7) == "respawn" then
local toRespawn = command:sub(9)
--[[
We're checking the characters after 8 this time since 'respawn' has 7
characters and there'll be a space after 'respawn'.
]]
end
end


3) Now, just call the tfm.exec.respawnPlayer command onto the player.


Code Lua

1
2
3
4
5
6
7
8
9
function eventChatCommand(name, command)
if command:sub(1, 4) == "kill" then
local toDie = command:sub(6)
tfm.exec.killPlayer(toDie)
elseif command:sub(1, 7) == "respawn" then
local toRespawn = command:sub(9)
tfm.exec.respawnPlayer(toRespawn)
end
end


Dernière modification le 1493637060000
Perfecteca
« Sénateur »
1493643240000
    • Perfecteca#0000
    • Profil
    • Derniers messages
    • Tribu
#2559
  1
Onkei a dit :

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
--[[
The eventChatCommand event gets called everytime someone types in
![command].

The eventChatCommand gives us access to two arguments, the parameters we get
is the name of the player (1) that executed the command, and the command name (2).
]]

function eventChatCommand(name, command)
--[[
string.sub() is a native Lua function that allows us to get a selected amount
of characters from a string, in this case; the first four characters
of the command entered.

If the first four characters is equal to "kill", then execute the following
line of code.
]]
if command:sub(1, 4) == "kill" then
--[[
Store the person selected into a variable, no need to do this.
command:sub(6) means that we're getting the rest of the string / command
entered after the first 5 characters.
]]
local toDie = command:sub(6)
--[[
tfm.exec.killPlayer is a TFM function that allows us to kill the player
with the name entered.
]]
tfm.exec.killPlayer(toDie)
end
end

Without comments;


Code Lua

1
2
3
4
5
6
function eventChatCommand(name, command)
if command:sub(1, 4) == "kill" then
local toDie = command:sub(6)
tfm.exec.killPlayer(toDie)
end
end


Here's an example on how to make other commands; If you want to create a command that respawns a selected player for example, you can use the tfm.exec.respawnPlayer function from the TFM API. To actually make it work with by calling !respawn [name], here's a simple tutorial following the code I used above.

1) First, check if the first command entered is equal to respawn.


Code Lua

1
2
3
4
5
6
7
8
function eventChatCommand(name, command)
if command:sub(1, 4) == "kill" then
local toDie = command:sub(6)
tfm.exec.killPlayer(toDie)
elseif command:sub(1, 7) == "respawn" then
-- We're checking for 7 characters since 'respawn' has 7 characters.
end
end


2) Similarly to the !kill [name] command, we get the name of the player into a variable.


Code Lua

1
2
3
4
5
6
7
8
9
10
11
12
function eventChatCommand(name, command)
if command:sub(1, 4) == "kill" then
local toDie = command:sub(6)
tfm.exec.killPlayer(toDie)
elseif command:sub(1, 7) == "respawn" then
local toRespawn = command:sub(9)
--[[
We're checking the characters after 8 this time since 'respawn' has 7
characters and there'll be a space after 'respawn'.
]]
end
end


3) Now, just call the tfm.exec.respawnPlayer command onto the player.


Code Lua

1
2
3
4
5
6
7
8
9
function eventChatCommand(name, command)
if command:sub(1, 4) == "kill" then
local toDie = command:sub(6)
tfm.exec.killPlayer(toDie)
elseif command:sub(1, 7) == "respawn" then
local toRespawn = command:sub(9)
tfm.exec.respawnPlayer(toRespawn)
end
end

Wow! That was really helpful. Thank you so so much! http://img.atelier801.com/0ca4f122.png
Msluvattack
« Citoyen »
1494042960000
    • Msluvattack#0000
    • Profil
    • Derniers messages
#2560
  0
i, don't know how too do the lua stuff ,i just wanna make npcs. why is it so complicated. =3=
  • Forums
  • /
  • Transformice
  • /
  • Modules
  • /
  • Script Requests
« ‹ 128 / 160 › »
© Atelier801 2018

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

Version 1.27