×

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] Cage In The House - block yourself in four ground
[Script] Cage In The House - block yourself in four ground
Bennynovice
« Citoyen »
1408263300000
    • Bennynovice#0000
    • Profil
    • Derniers messages
    • Tribu
#1
  0
Hi, everyone.

I wrote a little script. You can use this in your tribe house.

As the title, you can use the script to make someone to the block themselves.

When someone in the tribe house press 'down' button(or 's' button), a cage made by four normal ground will appear. Anyone press down button again the cage will change to that player.

http://i.imgur.com/4biMUNX.png

Escape From The Cage: When someone use kiss emotion, the cage will turn into cloud ground.

http://i.imgur.com/QG5HxfG.png
http://i.imgur.com/39DW6ZQ.png

And here is the script: http://pastebin.com/xQ5vitKc

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

Now I wrote a multi-ppl version, you can change the cage size and color in this one.

The script is here: http://pastebin.com/T124SQqk

Change 'cageSize' in the script to change the size.

Use command '!color 0xffffff' to change the color (white color for example).

http://i.imgur.com/WxXYsj5.png

You can also use the word of the color like '!color blue' to change the color.
The words are listed below. You can change this table in the script.

Use '!color default' to set to the wood ground.

colors = {
red = "0xFF0000",
pink = "0xFFC0CB",
purple = "0x800080",
chocolate = "0xD2691E",
orangered = "0xFF4500",
tomato = "0xFF6347",
gold = "0xFFD700",
yellow = "0xFFFF00",
lightyellow = "0xFFFFE0",
olive = "0x808000",
darkgreen = "0x006400",
forestgreen = "0x228B22",
lightseagreen = "0x20B2AA",
lime = "0x00FF00",
aquamarine = "0x7FFFD4",
blue = "0x0000FF",
cyan = "0x00FFFF",
black = "0x000000",
gray = "0x808080",
white = "0xFFFFFF"
}

Dernière modification le 1408857480000
Cheetahkitty
« Citoyen »
1408291620000
    • Cheetahkitty#0000
    • Profil
    • Derniers messages
    • Tribu
#2
  0
Cool script and when I use it I can move kind of like a Hamster in a Ball Good script :3 But, You can easily get out by the mouse in the Cage does the kiss emote http://i.imgur.com/q0KsPgz.jpg
Laidsid
« Citoyen »
1408476360000
    • Laidsid#0000
    • Profil
    • Derniers messages
    • Tribu
#3
  0
NVM IT WORKS!

Dernière modification le 1408476420000
Shinx
« Citoyen »
1408544880000
    • Shinx#4719
    • Profil
    • Derniers messages
    • Tribu
#4
  0
Super awesome,but man do you can set it for a single player,not for all?
Frozenjord
« Citoyen »
1408546380000
    • Frozenjord#0656
    • Profil
    • Derniers messages
    • Tribu
#5
  0
Cucsmardul a dit :
Super awesome,but man do you can set it for a single player,not for all?

At the beginning of the script where you see this:
function eventNewPlayer(name)
for i,key in ipairs({40,83}) do
tfm.exec.bindKeyboard(name,key,true,true)
end
end

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

Replace all of it with just this:
for i,key in ipairs({40,83}) do
tfm.exec.bindKeyboard("Insert name here",key,true,true)
end

Where it says "Insert name here" type your username.
Crazysushi
« Citoyen »
1408552920000
    • Crazysushi#0000
    • Profil
    • Derniers messages
#6
  0
Is it possible to have 2 people trapped in a box? Because my friend and I want to have a box race *^*
Bennynovice
« Citoyen »
1408693560000
    • Bennynovice#0000
    • Profil
    • Derniers messages
    • Tribu
#7
  0
Crazysushi a dit :
Is it possible to have 2 people trapped in a box? Because my friend and I want to have a box race *^*

Two people version:
name1="aaa"
name2="bbb"

for i,key in ipairs({40,83}) do
tfm.exec.bindKeyboard(name1,key,true,true)
tfm.exec.bindKeyboard(name2,key,true,true)
end

name1ID = 1
name2ID = 5

ground = {
name1 = {
downx=0,
downy=0,
leftx=0,
lefty=0,
rightx=0,
righty=0,
upx=0,
upy=0
},
name2 = {
downx=0,
downy=0,
leftx=0,
lefty=0,
rightx=0,
righty=0,
upx=0,
upy=0
}
}

bodyDef = {
type = 0,
width = 60,
height = 10,
foreground = false,
friction = 0.3,
restitution = 0.2,
angle = 0,
miceCollision = true,
groundCollision = false,
dynamic = false,
fixedRotation = true,
mass = 0,
linearDamping = 0,
angularDamping = 0
}

function eventKeyboard(name,key,down,x,y)
local id = name1ID
local nameid = "name1"
if name==name2 then
id = name2ID
nameid = "name2"
end

-- up and down ground
tfm.exec.removePhysicObject(id)
bodyDef.type=0
bodyDef.width=60
bodyDef.height=10
bodyDef.miceCollision = true
test = tfm.exec.addPhysicObject(id, x, y+20, bodyDef)
ground[nameid].downx=x
ground[nameid].downy=y+20
tfm.exec.removePhysicObject(id+1)
test = tfm.exec.addPhysicObject(id+1, x, y-30, bodyDef)
ground[nameid].upx=x
ground[nameid].upy=y-30

-- left and right ground
tfm.exec.removePhysicObject(id+2)
bodyDef.type=0
bodyDef.width=10
bodyDef.height=60
bodyDef.miceCollision = true
test = tfm.exec.addPhysicObject(id+2, x-25, y-5, bodyDef)
ground[nameid].leftx=x-25
ground[nameid].lefty=y-5
tfm.exec.removePhysicObject(id+3)
test = tfm.exec.addPhysicObject(id+3, x+25, y-5, bodyDef)
ground[nameid].rightx=x+25
ground[nameid].righty=y-5
end

function eventEmotePlayed(playerName,emote)
local id = name1ID
local nameid = "name1"
if playerName==name2 then
id = name2ID
nameid = "name2"
end

if emote==3 and playerName==name1 or playerName==name2 then
-- up and down ground
tfm.exec.removePhysicObject(id)
bodyDef.type=8
bodyDef.width=60
bodyDef.height=10
bodyDef.miceCollision = false
test = tfm.exec.addPhysicObject(id, ground[nameid].downx, ground[nameid].downy, bodyDef)
tfm.exec.removePhysicObject(id+1)
test = tfm.exec.addPhysicObject(id+1, ground[nameid].upx, ground[nameid].upy, bodyDef)

-- left and right ground
tfm.exec.removePhysicObject(id+2)
bodyDef.type=8
bodyDef.width=10
bodyDef.height=60
bodyDef.miceCollision = false
test = tfm.exec.addPhysicObject(id+2, ground[nameid].leftx, ground[nameid].lefty, bodyDef)
tfm.exec.removePhysicObject(id+3)
test = tfm.exec.addPhysicObject(id+3, ground[nameid].rightx, ground[nameid].righty, bodyDef)
end
end


Replace "aaa" and "bbb"

Dernière modification le 1408710420000
Cutylilian
« Citoyen »
1408707540000
    • Cutylilian#0000
    • Profil
    • Derniers messages
    • Tribu
#8
  0
Pastebin please?
Uifer
« Citoyen »
1408839300000
    • Uifer#0000
    • Profil
    • Derniers messages
    • Tribu
#9
  0
Omg, I love this. ♥

Is possible for 3 or 4 people to be trapped in the box? Or been trapped in a bigger box?

Dernière modification le 1408840080000
Mipmippp
« Citoyen »
1409787720000
    • Mipmippp#0000
    • Profil
    • Derniers messages
#10
  0
Uifer a dit :
Omg, I love this. ♥

Is possible for 3 or 4 people to be trapped in the box? Or been trapped in a bigger box?

You can change the size of the box, at this script when it says:

--Cage In The House (multi-ppl version)

--change the size of the cage
cageSize=60

players = {}
nextGroundID = 1001

you can change that number to the number you want.
Camila_cabello
« Citoyen »
1416697380000
    • Camila_cabello#0000
    • Profil
    • Derniers messages
    • Tribu
#11
  0
It Doesn't Work for me :C
Dreamingmous
« Citoyen »
1416770700000
    • Dreamingmous#0000
    • Profil
    • Derniers messages
    • Tribu
#12
  0
I played with my friend and we found out that !color can make invisible cages!
:DDDDD

btw nice script *-*

Dernière modification le 1416770760000
Jordy
« Consul »
1416787020000
    • Jordy#0015
    • Profil
    • Derniers messages
    • Tribu
#13
  0
Great scripts.
Camila_cabello
« Citoyen »
1416892680000
    • Camila_cabello#0000
    • Profil
    • Derniers messages
    • Tribu
#14
  0
how do u do it, it wont let me
Animaljamvid
« Citoyen »
1416957120000
    • Animaljamvid#0000
    • Profil
    • Derniers messages
    • Tribu
#15
  0
it wont work help please ive tried dozens of times but nothing happens

Dernière modification le 1416957780000
  • Forums
  • /
  • Transformice
  • /
  • Modules
  • /
  • [Script] Cage In The House - block yourself in four ground
© Atelier801 2018

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

Version 1.27