×

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] The floor is lava
1 / 3 › »
[Script] The floor is lava
Osicat
« Citoyen »
1503322860000
    • Osicat#0000
    • Profil
    • Derniers messages
    • Tribu
#1
  28
The floor is lava? I think it is funny and easy to make. I have made my own "the floor is lava" and the code is below. It is not the best, but it works :D
Should it be added to transformice? What do you think about it?

Code
tfm.exec.setGameTime(6000,true)
tfm.exec.disableAutoShaman(true)
tfm.exec.disableAutoNewGame(true)
tfm.exec.newGame(7214563)
ilosc = 10
tfm.exec.addPhysicObject(1,800,387,{
type=6,
restitution=0.2,
friction=0.3,
width=1600,
height=37,
groundCollision=true,
miceCollision=true
})
to=0
czas=10
score = 0


function eventLoop(timeRemaining,timeRemaining)
if(to==2) then
czas=czas-1
score = score + 1
if(czas==3) then

x = math.random(100,1500)
xx = math.random(100,1500)
idd = math.random(1,7)
id = math.random(1,7)
usun = tfm.exec.addShamanObject(id,x,350,0,0,0,false)
usunn = tfm.exec.addShamanObject(idd,xx,350,0,0,0,false)
end
if(czas==-3) then
tfm.exec.removeObject(usun)
tfm.exec.removeObject(usunn)
ilosc = ilosc - 1
czas=ilosc
tfm.exec.addPhysicObject(1,800,387,{
type=6,
restitution=0.2,
friction=0.3,
width=1600,
height=37,
groundCollision=true,
miceCollision=true
})
tfm.exec.removePhysicObject(2)
end

if(czas<=0) then

tfm.exec.addPhysicObject(1,800,387,{
type=6,
restitution=0.2,
friction=0.3,
width=1600,
height=37,
groundCollision=true,
miceCollision=false
})
tfm.exec.addPhysicObject(2,800,387,{
type=3,
restitution=0.2,
friction=0.3,
width=1600,
height=37,
groundCollision=true,
miceCollision=false
})

ui.addTextArea(7, "<p align='center'><font size='50' color='#FF0000'>THE FLOOR IS LAVA</font></p>", nil, 50, 125, 700, 119, 0x324650, 0x000000, 0, true,true)
else
ui.addTextArea(7, "<p align='center'><font size='90'>"..czas.."</font></p>", nil, 50, 125, 700, 119, 0x324650, 0x000000, 0, true,true)
ui.addTextArea(5,"", nil, 50, 250, 700, 119, 0x324650, 0x000000, 0, true,true)
end
to=0
else
to=to+1
end
if(ilosc==4) then
ilosc=10
end
end
function eventPlayerDied(playerName)
tfm.exec.setUIShamanName(playerName.." has died.")
tfm.exec.setPlayerScore(playerName,-2,true)
end
function eventChatCommand(playerName,message)
if(message=="reset") then
tfm.exec.setPlayerScore(playerName,0)
end
end
liczba=0
tablica={}
zycie={}
e=0
for name, player in pairs(tfm.get.room.playerList) do
tablica[name]=0
e=e+1

print(name)
end
print(e)
function eventPlayerDied(n)
tablica[n]=1
zycie[n]=0
e=e-1
print(e)
for name, player in pairs(tfm.get.room.playerList) do
if(tablica[name]==0) then
liczba=liczba+1
wyg=name
end
end
function eventPlayerLeft(n)
tablica[n]=1
zycie[n]=0
e=e-1
print(e)
for name, player in pairs(tfm.get.room.playerList) do
if(tablica[name]==0) then
liczba=liczba+1
wyg=name
end
end
end
if(liczba==1) then
print(wyg.." wygral")
tfm.exec.giveCheese(wyg)
ui.addTextArea(5, "<p align='center'><font size='50' color='#FFFF00'>"..wyg.." has won the game</font></p>", nil, 50, 250, 700, 500, 0x324650, 0x000000, 0, true,true)
tfm.exec.playerVictory(wyg)
tfm.exec.newGame(7214563)
tfm.exec.addPhysicObject(1,800,387,{
type=6,
restitution=0.2,
friction=0.3,
width=1600,
height=37,
groundCollision=true,
miceCollision=true
})
to=0
czas=10
score = 0
e=0
tablica={}
ilosc=10
tfm.exec.setPlayerScore(wyg,score,true)
for name, player in pairs(tfm.get.room.playerList) do
tablica[name]=0
zycie[name]=1
e=e+1
end
wyg=""
liczba=0
print(e)
else
liczba=0
end
end
function eventChatCommand(playerName,message)
if(message=="res") then
liczba=0
e=0
tablica={}
for name, player in pairs(tfm.get.room.playerList) do
tablica[name]=0

e=e+1
end
wyg=""
print(e)
end
end
function eventPlayerRespawn(nn)
if(zycie[nn]==0) then
tfm.exec.setVampirePlayer(nn)
end
end



Code v1.1
tfm.exec.setGameTime(6000,true)
tfm.exec.disableAutoShaman(true)
tfm.exec.disableAutoNewGame(true)
tfm.exec.setUIMapName("The floor is lava!")
tfm.exec.newGame(7214563)
ilosc = 10
tfm.exec.addPhysicObject(1,800,387,{
type=6,
restitution=0.2,
friction=0.3,
width=1600,
height=37,
groundCollision=true,
miceCollision=true
})
to=0
czas=10
score = 0


function eventLoop(timeRemaining,timeRemaining)
if(to==2) then
czas=czas-1
score = score + 1
if(score==10) then
for name, player in pairs(tfm.get.room.playerList) do
tfm.exec.giveMeep(name)
end
end

if(czas==3) then

x = math.random(100,1500)
xx = math.random(100,1500)
idd = math.random(1,7)
id = math.random(1,7)


usun = tfm.exec.addShamanObject(id,x,350,0,0,0,false)
usunn = tfm.exec.addShamanObject(idd,xx,350,0,0,0,false)

end
if(czas==-3) then
tfm.exec.removeObject(usun)
tfm.exec.removeObject(usunn)

ilosc = ilosc - 1
czas=ilosc
tfm.exec.addPhysicObject(1,800,387,{
type=6,
restitution=0.2,
friction=0.3,
width=1600,
height=37,
groundCollision=true,
miceCollision=true
})
tfm.exec.removePhysicObject(2)
end

if(czas<=0) then

tfm.exec.addPhysicObject(1,800,387,{
type=6,
restitution=0.2,
friction=0.3,
width=1600,
height=37,
groundCollision=true,
miceCollision=false
})
tfm.exec.addPhysicObject(2,800,387,{
type=3,
restitution=0.2,
friction=0.3,
width=1600,
height=37,
groundCollision=true,
miceCollision=false
})

ui.addTextArea(7, "<p align='center'><font size='50' color='#FF0000'>THE FLOOR IS LAVA</font></p>", nil, 50, 125, 700, 119, 0x324650, 0x000000, 0, true,true)
else
ui.addTextArea(7, "<p align='center'><font size='90'>"..czas.."</font></p>", nil, 50, 125, 700, 119, 0x324650, 0x000000, 0, true,true)
ui.addTextArea(5,"", nil, 50, 250, 700, 119, 0x324650, 0x000000, 0, true,true)
end
to=0
else
to=to+1
end
if(ilosc==4) then
ilosc=10
end
end
function eventPlayerDied(playerName)
tfm.exec.setUIShamanName(playerName.." has died.")
tfm.exec.setPlayerScore(playerName,-2,true)
end
function eventChatCommand(playerName,message)
if(message=="reset") then
tfm.exec.setPlayerScore(playerName,0)
end
end
liczba=0
tablica={}
zycie={}
e=0
for name, player in pairs(tfm.get.room.playerList) do
tablica[name]=0
e=e+1

print(name)
end
print(e)
function eventPlayerDied(n)
tablica[n]=1
zycie[n]=0
e=e-1
print(e)
for name, player in pairs(tfm.get.room.playerList) do
if(tablica[name]==0) then
liczba=liczba+1
wyg=name
end
end
function eventPlayerLeft(n)
tablica[n]=1
zycie[n]=0
e=e-1
print(e)
for name, player in pairs(tfm.get.room.playerList) do
if(tablica[name]==0) then
liczba=liczba+1
wyg=name
end
end
end
if(liczba==1) then
print(wyg.." wygral")
tfm.exec.giveCheese(wyg)
ui.addTextArea(5, "<p align='center'><font size='50' color='#FFFF00'>"..wyg.." has won the game</font></p>", nil, 50, 250, 700, 500, 0x324650, 0x000000, 0, true,true)
tfm.exec.playerVictory(wyg)
tfm.exec.newGame(7214563)
tfm.exec.addPhysicObject(1,800,387,{
type=6,
restitution=0.2,
friction=0.3,
width=1600,
height=37,
groundCollision=true,
miceCollision=true
})
to=0
czas=10
score = 0
e=0
tablica={}
ilosc=10
tfm.exec.setPlayerScore(wyg,score,true)
for name, player in pairs(tfm.get.room.playerList) do
tablica[name]=0
zycie[name]=1
e=e+1
end
wyg=""
liczba=0
print(e)
else
liczba=0
end
end
function eventChatCommand(playerName,message)
if(message=="res") then
liczba=0
e=0
tablica={}
for name, player in pairs(tfm.get.room.playerList) do
tablica[name]=0

e=e+1
end
wyg=""
print(e)
end
end
function eventPlayerRespawn(nn)
if(zycie[nn]==0) then
tfm.exec.setVampirePlayer(nn)
end
end


Added:
  • MEEP after 10 seconds
  • Map name has been changed to "The floor is lava"


Code v1.2
map={
7214563,
7273409
}

tfm.exec.setGameTime(6000,true)
tfm.exec.disableAutoShaman(true)
tfm.exec.disableAutoNewGame(true)
tfm.exec.setUIMapName("The floor is lava!")
tfm.exec.newGame(map[math.random(#map)])
ilosc = 10
for name, player in pairs(tfm.get.room.playerList) do
tfm.exec.setPlayerScore(name,0)
end

tfm.exec.addPhysicObject(1,800,387,{
type=6,
restitution=0.2,
friction=0.3,
width=1600,
height=37,
groundCollision=true,
miceCollision=true
})
to=0
czas=10
score = 0


function eventLoop(timeRemaining,timeRemaining)
if(to==2) then
czas=czas-1
score = score + 1
if(score==10) then
for name, player in pairs(tfm.get.room.playerList) do
tfm.exec.giveMeep(name)
end
end
if(czas==3) then
usun = tfm.exec.addShamanObject(math.random(1,7),math.random(100,1500),350,0,0,0,false)
usunn = tfm.exec.addShamanObject(math.random(1,7),math.random(100,1500),350,0,0,0,false)

end
if(czas==-3) then
tfm.exec.removeObject(usun)
tfm.exec.removeObject(usunn)

ilosc = ilosc - 1
czas=ilosc
tfm.exec.addPhysicObject(1,800,387,{
type=6,
restitution=0.2,
friction=0.3,
width=1600,
height=37,
groundCollision=true,
miceCollision=true
})
tfm.exec.removePhysicObject(2)
end

if(czas<=0) then

tfm.exec.addPhysicObject(1,800,387,{
type=6,
restitution=0.2,
friction=0.3,
width=1600,
height=37,
groundCollision=true,
miceCollision=false
})
tfm.exec.addPhysicObject(2,800,387,{
type=3,
restitution=0.2,
friction=0.3,
width=1600,
height=37,
groundCollision=true,
miceCollision=false
})

ui.addTextArea(7, "<p align='center'><font size='50' color='#FF0000'>THE FLOOR IS LAVA</font></p>", nil, 50, 125, 700, 119, 0x324650, 0x000000, 0, true,true)
else
ui.addTextArea(7, "<p align='center'><font size='90'>"..czas.."</font></p>", nil, 50, 125, 700, 119, 0x324650, 0x000000, 0, true,true)
ui.addTextArea(5,"", nil, 50, 250, 700, 119, 0x324650, 0x000000, 0, true,true)
end
to=0
else
to=to+1
end
if(ilosc==4) then
ilosc=10
end
end
liczba=0
tablica={}
zycie={}
e=0
for name, player in pairs(tfm.get.room.playerList) do
tablica[name]=0
e=e+1

print(name)
end
print(e)
function eventPlayerDied(n)
tfm.exec.setUIShamanName(n.." has died.")
tfm.exec.setPlayerScore(n,-2,true)
tablica[n]=1
zycie[n]=0
e=e-1
print(e)
for name, player in pairs(tfm.get.room.playerList) do
if(tablica[name]==0) then
liczba=liczba+1
wyg=name
end
end
function eventPlayerLeft(n)
tablica[n]=1
zycie[n]=0
e=e-1
print(e)
for name, player in pairs(tfm.get.room.playerList) do
if(tablica[name]==0) then
liczba=liczba+1
wyg=name
end
end
end
if(liczba==1) then
print(wyg.." wygral")
tfm.exec.giveCheese(wyg)
ui.addTextArea(5, "<p align='center'><font size='50' color='#FFFF00'>"..wyg.." has won the game</font></p>", nil, 50, 250, 700, 500, 0x324650, 0x000000, 0, true,true)
tfm.exec.playerVictory(wyg)
tfm.exec.newGame(map[math.random(#map)])
tfm.exec.addPhysicObject(1,800,387,{
type=6,
restitution=0.2,
friction=0.3,
width=1600,
height=37,
groundCollision=true,
miceCollision=true
})
to=0
czas=10
score = 0
e=0
tablica={}
ilosc=10
tfm.exec.setPlayerScore(wyg,score,true)
for name, player in pairs(tfm.get.room.playerList) do
tablica[name]=0
zycie[name]=1
e=e+1
end
wyg=""
liczba=0
print(e)
else
liczba=0
end
end
function eventPlayerRespawn(nn)
if(zycie[nn]==0) then
tfm.exec.setVampirePlayer(nn)
end
end

New:
  • Map rotation
  • Code is now shorter

Dernière modification le 1506111300000
Osicat
« Citoyen »
1503322920000
    • Osicat#0000
    • Profil
    • Derniers messages
    • Tribu
#2
  1
I forgot to remove some lines that were used to debugging.

Dernière modification le 1505067840000
Dobrymisiu
« Consul »
1503325380000
    • Dobrymisiu#0000
    • Profil
    • Derniers messages
#3
  3
this should be in modules
anyway cool
Ash_willow_iz
« Consul »
1503326280000
    • Ash_willow_iz#9815
    • Profil
    • Derniers messages
    • Tribu
#4
  1
/support
Myszkaprokox
« Citoyen »
1503330600000
    • Myszkaprokox#0000
    • Profil
    • Derniers messages
    • Tribu
#5
  1
/support
Fly
« Citoyen »
1503358080000
    • Fly#8215
    • Profil
    • Derniers messages
    • Tribu
#6
  1
Dobrymisiu a dit :
this should be in modules
anyway cool
Taco1
« Citoyen »
1503501720000
    • Taco1#0000
    • Profil
    • Derniers messages
    • Tribu
#7
  1
/support
Dagemaps
« Citoyen »
1504223880000
    • Dagemaps#9072
    • Profil
    • Derniers messages
    • Tribu
#8
  1
Good game :3
Reijinho
« Citoyen »
1504828140000
    • Reijinho#0000
    • Profil
    • Derniers messages
    • Tribu
#9
  1
/support
Zajaci
« Censeur »
1505191920000
    • Zajaci#8309
    • Profil
    • Derniers messages
    • Tribu
#11
  1
/support
Sebafrancuz
« Consul »
1505249580000
    • Sebafrancuz#0000
    • Profil
    • Derniers messages
    • Tribu
#12
  1
I think this module ia a bit small to be official module, but good work and goos luck !
Imyoda
1505304300000
    • Imyoda#0000
    • Profil
    • Derniers messages
#13
[Modéré par Lament, raison : Off-topic.]
Osicat
« Citoyen »
1505734320000
    • Osicat#0000
    • Profil
    • Derniers messages
    • Tribu
#14
  1
Sebafrancuz a dit :
I think this module ia a bit small to be official module, but good work and goos luck !

Maybe it is. Wait... What about dancefloor? :D
Sodasilver
« Censeur »
1506096960000
    • Sodasilver#5821
    • Profil
    • Derniers messages
#15
  1
/support
Myhappyness
« Citoyen »
1506109260000
    • Myhappyness#0000
    • Profil
    • Derniers messages
    • Tribu
#16
  1
/support
Dobrymisiu
« Consul »
1506855660000
    • Dobrymisiu#0000
    • Profil
    • Derniers messages
#17
  1
cool :)
very cool
Mclaren
« Citoyen »
1515638160000
    • Mclaren#1519
    • Profil
    • Derniers messages
    • Tribu
#18
  1
/support
Kimsterjay
« Consul »
1515672180000
    • Kimsterjay#0000
    • Profil
    • Derniers messages
    • Tribu
#19
  2
simple and fun, good luck ^^
Benucka
« Citoyen »
1517403480000
    • Benucka#0000
    • Profil
    • Derniers messages
#20
  1
Good luck I hope it works
  • Forums
  • /
  • Transformice
  • /
  • Modules
  • /
  • [Script] The floor is lava
1 / 3 › »
© Atelier801 2018

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

Version 1.27