×

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
« ‹ 130 / 160 › »
Script Requests
Onkei
« Citoyen »
1497089340000
    • Onkei#0000
    • Profil
    • Derniers messages
    • Tribu
#2581
  1
Noonicknames a dit :
I need help to make a killing system so that if you are the police and press space 5 pixels or nearer away from the murderer he'll die.

Sorry, I'm not really sure what you mean so I made this script to demonstrate how you'd detect if someone is within 5 pixels of a person. You can change the if statement to achieve what-ever you want.


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 police = "Noonicknames"
local RANGE = 5

system.bindKeyboard(police, 32, true, true)

function eventKeyboard(n, key, down, x, y)
if key == 32 then
for n2, data in pairs(tfm.get.room.playerList) do
--[[
math.abs gives us a number that'll always be positive.
To get the distance between two players, we subtract their positions.
]]
local xDist, yDist = math.abs(x - data.x), math.abs(y - data.y)

--[[
Checking if the xDist and yDist are both within the range.
]]
if xDist < RANGE and yDist < RANGE then
--[[
Do whatever you want here.
]]
end
end
end
end
Honorabilis
« Consul »
1497091380000
    • Honorabilis#0000
    • Profil
    • Derniers messages
    • Tribu
#2582
  0
@Onkei Why we can not do directly this:

x - data.x < RANGE and y - data.y < RANGE
Onkei
« Citoyen »
1497092040000
    • Onkei#0000
    • Profil
    • Derniers messages
    • Tribu
#2583
  0
Honorabilis a dit :
@Onkei Why we can not do directly this:

x - data.x < RANGE and y - data.y < RANGE

I don't think there's anything wrong with doing that, it's just that if you want to compare the distance between certain values, the math.abs will be required since the value may become negative (how2explain?).


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 xDist, yDist = math.abs(x - data.x), math.abs(y - data.y)

if xDist < RANGE and yDist < RANGE then

end

-- same as

if x - data.x < RANGE and y - data.y < RANGE then

end

------

local xDist, yDist = math.abs(x - data.x), math.abs(y - data.y)

if xDist > RANGE1 and xDist < RANGE2 and yDist > RANGE1 and yDist < RANGE2 then

end

-- may not be the same as

if x - data.x > RANGE1 and x - data.x < RANGE2 and y - data.y > RANGE1 and y - data.y < RANGE2 then

end
Honorabilis
« Consul »
1497096120000
    • Honorabilis#0000
    • Profil
    • Derniers messages
    • Tribu
#2584
  0
Onkei a dit :
Honorabilis a dit :
@Onkei Why we can not do directly this:

x - data.x < RANGE and y - data.y < RANGE

I don't think there's anything wrong with doing that, it's just that if you want to compare the distance between certain values, the math.abs will be required since the value may become negative (how2explain?).


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 xDist, yDist = math.abs(x - data.x), math.abs(y - data.y)

if xDist < RANGE and yDist < RANGE then

end

-- same as

if x - data.x < RANGE and y - data.y < RANGE then

end

------

local xDist, yDist = math.abs(x - data.x), math.abs(y - data.y)

if xDist > RANGE1 and xDist < RANGE2 and yDist > RANGE1 and yDist < RANGE2 then

end

-- may not be the same as

if x - data.x > RANGE1 and x - data.x < RANGE2 and y - data.y > RANGE1 and y - data.y < RANGE2 then

end

Cool^^
Kat
« Citoyen »
1497102300000
    • Kat#0106
    • Profil
    • Derniers messages
#2585
  0
Can you make a module? (name: building practice:) and in the rounds are 3 shams each time battling for the best building, the mice inside the block will vote and when the winner is picked you get to get the cheese and go in the hole
Thanks
Honorabilis
« Consul »
1497103620000
    • Honorabilis#0000
    • Profil
    • Derniers messages
    • Tribu
#2586
  0
Katsumiaaj a dit :
Can you make a module? (name: building practice:) and in the rounds are 3 shams each time battling for the best building, the mice inside the block will vote and when the winner is picked you get to get the cheese and go in the hole
Thanks

Here is not module suggestions thred!
Nihatsune
« Citoyen »
1497953640000
    • Nihatsune#1106
    • Profil
    • Derniers messages
    • Tribu
#2587
  0
Pls give me help menu
Honorabilis
« Consul »
1497961320000
    • Honorabilis#0000
    • Profil
    • Derniers messages
    • Tribu
#2588
  0
Fulgermacuin a dit :
Pls give me help menu

There is too many way to do a help menu.
Egecanege
« Citoyen »
1498301940000
    • Egecanege#0000
    • Profil
    • Derniers messages
    • Tribu
#2589
  0
hi, I need micebook script but old link is removed
Nox
« Citoyen »
1499371620000
    • Nox#2215
    • Profil
    • Derniers messages
    • Tribu
#2590
  0
function spawnArrow()
tfm.exec.addShamanObject(1, math.random()*800, -80)
end

except I only want them falling on a specific portion of the map on the right side
Onkei
« Citoyen »
1499371800000
    • Onkei#0000
    • Profil
    • Derniers messages
    • Tribu
#2591
  0
Bradmouser a dit :

except I only want them falling on a specific portion of the map on the right side


Code Lua

1
2
3
function spawnArrow()
tfm.exec.addShamanObject(1, math.random(400, 800), -80)
end
Lionheart199
« Citoyen »
1499735640000
    • Lionheart199#4754
    • Profil
    • Derniers messages
#2592
  0
Hello Shamousey, I have an issue with the event ones, I copy pasted them into my /lua thing in Tribe house, and submitted them, for me it just comes up the village..
Snowypaws380
« Citoyen »
1499876280000
    • Snowypaws380#0000
    • Profil
    • Derniers messages
#2593
  1
These are for scripts right because I was thinking on someone helping me make a rap battle room, if anyone would like to do this please message me
Honorabilis
« Consul »
1500320760000
    • Honorabilis#0000
    • Profil
    • Derniers messages
    • Tribu
#2594
  0
Onkei a dit :
Noonicknames a dit :
I need help to make a killing system so that if you are the police and press space 5 pixels or nearer away from the murderer he'll die.

Sorry, I'm not really sure what you mean so I made this script to demonstrate how you'd detect if someone is within 5 pixels of a person. You can change the if statement to achieve what-ever you want.


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 police = "Noonicknames"
local RANGE = 5

system.bindKeyboard(police, 32, true, true)

function eventKeyboard(n, key, down, x, y)
if key == 32 then
for n2, data in pairs(tfm.get.room.playerList) do
--[[
math.abs gives us a number that'll always be positive.
To get the distance between two players, we subtract their positions.
]]
local xDist, yDist = math.abs(x - data.x), math.abs(y - data.y)

--[[
Checking if the xDist and yDist are both within the range.
]]
if xDist < RANGE and yDist < RANGE then
--[[
Do whatever you want here.
]]
end
end
end
end

This is more useful. ('cus you will die too in yours :P)
Code Lua

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
local ebe = "Honorabilis"
local ara = 5

system.bindKeyboard(ebe, 32, true, true)

function eventKeyboard(n, key, down, x, y)
if key == 32 then
for o, data in pairs(tfm.get.room.playerList) do

local xU, yU = math.abs(x - data.x), math.abs(y - data.y)

if xU < ara and yU < ara and o ~= ebe then
tfm.exec.killPlayer(o)
end
end
end
end

Dernière modification le 1500321180000
Onkei
« Citoyen »
1500328800000
    • Onkei#0000
    • Profil
    • Derniers messages
    • Tribu
#2595
  1
Honorabilis a dit :

This is more useful. ('cus you will die too in yours :P)

Aha! That's true, didn't take the player pressing the key into consideration lol
Hergel1
« Citoyen »
1500756060000
    • Hergel1#0000
    • Profil
    • Derniers messages
    • Tribu
#2596
  0
When I Confetti
Chat Says
'' Hergel1 Threw A Pokeball! ''
Onkei
« Citoyen »
1500847680000
    • Onkei#0000
    • Profil
    • Derniers messages
    • Tribu
#2597
  0
Hergel1 a dit :

When I confetti, chat says;
'' Hergel1 Threw A Pokeball! ''

You can't send chat messages with Lua in the tribe house (without official module powers), so this script just puts in a textArea to where the player is standing.


Code Lua

1
2
3
4
5
6
7
8
9
10
11
12
13
function eventEmotePlayed(n, num)
-- 9 is confetti's emote number
if num == 9 then
-- Storing player coords into a variable
local data = tfm.get.room.playerList[n]

ui.addTextArea(0, "<b><a href='event:close'>" .. n .. " Threw A Pokeball!", nil, data.x, data.y, nil, 20, 0x0, 0x0, 0, false)
end
end

function eventTextAreaCallback(id, n, cb)
ui.removeTextArea(id, n)
end
Lalaweki
« Citoyen »
1500866580000
    • Lalaweki#0000
    • Profil
    • Derniers messages
    • Tribu
#2598
  0
Hey, I use to have access to a lua that I used but I lost it and would like to find a new one (or the same one)
Okay so, I sometimes have trouble with finding out who is playing a video in the tribe house and i used to use a lua that would tell me who clicks on the map (although it is not 100% saying who is changing the video, it helps find patterns in video changes and people's clicking habbits) and I would like a lua that says who is clicking on the map.
I know there is a chat command to play videos, but quite a few people just click that down arrow on the tv. Any help is appreciated.
Laagaadoo
« Citoyen »
1500867060000
    • Laagaadoo#0000
    • Profil
    • Derniers messages
    • Tribu
#2599
  0
Lalaweki a dit :
Hey, I use to have access to a lua that I used but I lost it and would like to find a new one (or the same one)
Okay so, I sometimes have trouble with finding out who is playing a video in the tribe house and i used to use a lua that would tell me who clicks on the map (although it is not 100% saying who is changing the video, it helps find patterns in video changes and people's clicking habbits) and I would like a lua that says who is clicking on the map.
I know there is a chat command to play videos, but quite a few people just click that down arrow on the tv. Any help is appreciated.

Is this one that you want?

Dernière modification le 1500867960000
Unikalus
« Citoyen »
1500894600000
    • Unikalus#0000
    • Profil
    • Derniers messages
    • Tribu
#2600
  0
How to make economy? Or something like that
  • Forums
  • /
  • Transformice
  • /
  • Modules
  • /
  • Script Requests
« ‹ 130 / 160 › »
© Atelier801 2018

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

Version 1.27