×

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
  • /
  • Archives
  • /
  • Seção Editor de Mapas e Modules
  • /
  • [Lua] Peça scripts aqui!
« ‹ 24 / 133 › »
[Lua] Peça scripts aqui!
Thetrueprime
« Citoyen »
1514585340000
    • Thetrueprime#0000
    • Profil
    • Derniers messages
    • Tribu
#461
  0
Obrigado,mas, você teria como fazer o objeto spawnar aleatoriamente?
Bolodefchoco
« Sénateur »
1514589900000
    • Bolodefchoco#0095
    • Profil
    • Derniers messages
    • Tribu
#462
  1
Thetrueprime a dit :
Obrigado,mas, você teria como fazer o objeto spawnar aleatoriamente?

Claro.

Code Lua

1
2
3
4
5
6
7
8
9
10
11
12
13
14
SEGUNDOS_PARA_DESAPARECER = 3
id = tfm.exec.addShamanObject(1, math.random(50, 750), math.random(30,300))

local time = 0
eventLoop = function()
if time >= 0 then
time = time + .5
end

if time == SEGUNDOS_PARA_DESAPARECER then
tfm.exec.removeObject(id)
time = -1
end
end

Dernière modification le 1514589960000
Thetrueprime
« Citoyen »
1514590500000
    • Thetrueprime#0000
    • Profil
    • Derniers messages
    • Tribu
#463
  0
Obrigado :D
Fellipybr1
« Citoyen »
1514746320000
    • Fellipybr1#0000
    • Profil
    • Derniers messages
#464
  0
Como faço pra fazer que bote aqueles mapas de surivvors que sai cn sozinho no cafofo da tribo ?
Bolodefchoco
« Sénateur »
1514746980000
    • Bolodefchoco#0095
    • Profil
    • Derniers messages
    • Tribu
#465
  0
Fellipybr1 a dit :
Como faço pra fazer que bote aqueles mapas de surivvors que sai cn sozinho no cafofo da tribo ?

/module #cannonup

Você pode jogar o módulo em qualquer sala #cannonup
Isayayaa
« Citoyen »
1514754840000
    • Isayayaa#3725
    • Profil
    • Derniers messages
    • Tribu
#466
  0
Eu queria um script que quando vc apertasse espaço saia galinhas <3
Bolodefchoco
« Sénateur »
1514760300000
    • Bolodefchoco#0095
    • Profil
    • Derniers messages
    • Tribu
#467
  0
Melinah3ar a dit :
Eu queria um script que quando vc apertasse espaço saia galinhas <3

Code Lua

1
2
3
4
5
6
7
8
9
10
11
VELOCIDADE_GALINHA = 10

eventNewPlayer = function(n)
system.bindKeyboard(n, 32, true, true)
end
table.foreach(tfm.get.room.playerList, eventNewPlayer)

eventKeyboard = function(n, k, d, x, y)
local facingValue = tfm.get.room.playerList[n].isFacingRight and 1 or -1
tfm.exec.addShamanObject(33, x + (30 * facingValue), y - 5, 0, VELOCIDADE_GALINHA * facingValue)
end
Travonrodfer
« Censeur »
1514919300000
    • Travonrodfer#0000
    • Profil
    • Derniers messages
    • Tribu
#468
  0
Ola, alguém poderia fazer um script assim pra mim:
O rato que estiver nessa parte marcada de vermelho no mapa deve morrer.
A cada cinco segundos isso é desativado possibilitando a passagem, e aí continua o loop infinito.
Ativando e desativando no intervalo de cinco segundos.

https://image.prntscr.com/image/kvWGyUJRQjeL13O_ZomRhQ.png
Samu
1514925480000
    • Samu#4454
    • Profil
    • Derniers messages
    • Tribu
#469
[Modéré par Quatrogivas, raison : Caráter sexual]
Bolodefchoco
« Sénateur »
1514926980000
    • Bolodefchoco#0095
    • Profil
    • Derniers messages
    • Tribu
#470
  0
Travonrodfer a dit :
Ola, alguém poderia fazer um script assim pra mim:
O rato que estiver nessa parte marcada de vermelho no mapa deve morrer.
A cada cinco segundos isso é desativado possibilitando a passagem, e aí continua o loop infinito.
Ativando e desativando no intervalo de cinco segundos.

https://image.prntscr.com/image/kvWGyUJRQjeL13O_ZomRhQ.png

Poderia me dar as coordenadas?
Exemplo:
Entre X, Y e X1, Y1
O rato deve pisar ou é em qualquer altura que aquele X mata?
Os pontos que eu coloquei foram
de 0 a 100
de 350 a 450
de 700 a 800

E não importa a altura, apenas a posição horizontal.
Me informe se precisar de edições

Code Lua

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
coordenadas = {{0, 100}, {350, 450}, {700, 800}}

matar = false
tempo = 0
eventLoop = function()
tempo = tempo + .5
if tempo % 5 == 0 then
matar = not matar
end

if matar then
for n,p in next,tfm.get.room.playerList do
for k,v in next,coordenadas do
if p.x >= v[1] and p.x <= v[2] then
tfm.exec.killPlayer(n)
end
end
end
end
end

Dernière modification le 1514927640000
Quinckas
« Citoyen »
1515086880000
    • Quinckas#0579
    • Profil
    • Derniers messages
    • Tribu
#471
  0
oi
como faço para uma função encontrar uma parte de uma string e adicionar uma palavra ao lado dela?
acho que precisa usar string.find e .format mas tenho muita dificuldade :(
caso não esteja muito claro quero algo assim
Code Lua

1
2
3
4
5
6
7
8
9
10
11
string = "Exemplo"
palavraAdd = "oi"
parteString = "emp"

function blabla(string)
...
end

print(string) >>> -- Exemplo
string = blabla(string)
print(string) >>> -- Exemp oi lo
caso a string tenha "emp" será adicionado "oi"
espero que tenha dado para entender
Bolodefchoco
« Sénateur »
1515087540000
    • Bolodefchoco#0095
    • Profil
    • Derniers messages
    • Tribu
#472
  0
Quinzinhojr a dit :
oi
como faço para uma função encontrar uma parte de uma string e adicionar uma palavra ao lado dela?
acho que precisa usar string.find e .format mas tenho muita dificuldade :(
caso não esteja muito claro quero algo assim
Code Lua

1
2
3
4
5
6
7
8
9
10
11
string = "Exemplo"
palavraAdd = "oi"
parteString = "emp"

function blabla(string)
...
end

print(string) >>> -- Exemplo
string = blabla(string)
print(string) >>> -- Exemp oi lo
caso a string tenha "emp" será adicionado "oi"
espero que tenha dado para entender

Você pode usar a função string.gsub(String, Find, Replace)

Code Lua

1
2
3
4
5
6
7
8
9
-- Nunca crie uma variável chamada string porque ela deletaria todas as funções da tabela "string"
-- O mesmo para "math", "io", "table", "debug", ...
str = "Exemplo"
palavraAdd = "oi" -- Para que o resultado seja "Exemp oi lo", defina palavraAdd como " oi " ao invés de "oi"
parteString = "emp"

-- "%1" = parteString
str = string.gsub(str, parteString, "%1"..palavraAdd) -- ou str:gsub(parteString, "%1"..palavraAdd)
print(str) -- Exempoilo

Dernière modification le 1515087840000
Quinckas
« Citoyen »
1515090720000
    • Quinckas#0579
    • Profil
    • Derniers messages
    • Tribu
#473
  0
Bolodefchoco a dit :
[...]

obgg  
Laylalinhhhhhh
« Citoyen »
1515355800000
    • Laylalinhhhhhh#0632
    • Profil
    • Derniers messages
#474
  0
alguem, pode fazer um script pra mim tipo muda o nick do jogador que esta no cafofo e ele poder ver o nick dele mudado
e se não for muito faz um script
com desafios tipo de provas

Dernière modification le 1515355920000
Bolodefchoco
« Sénateur »
1515357840000
    • Bolodefchoco#0095
    • Profil
    • Derniers messages
    • Tribu
#475
  0
Quemevc6 a dit :
alguem, pode fazer um script pra mim tipo muda o nick do jogador que esta no cafofo e ele poder ver o nick dele mudado
e se não for muito faz um script
com desafios tipo de provas

Lua não permite alterar o nome do jogador.

Existe um quiz feito pelo Ninguem:
Galeria do Ninguem a dit :

É um script que gerencia um questionário para você fazer em sua tribo. Coloque suas perguntas e respostas a serem consideradas corretas no código e deixe os membros responderem. A vitória é dada quando todas forem respondidas corretamente.

Última versão: http://pastebin.com/raw/EvwwmMAe

E também "Verdade ou Desafio", por Mousetat, porém em inglês, aqui.
Hypersperer
« Citoyen »
1515441960000
    • Hypersperer#1477
    • Profil
    • Derniers messages
    • Tribu
#476
  0
Clicar e soltar espirito (Só eu), por favor
Rufflesdqjo
« Citoyen »
1515442560000
    • Rufflesdqjo#0095
    • Profil
    • Derniers messages
    • Tribu
#477
  0
Sperer a dit :
Clicar e soltar espirito (Só eu), por favor

Code Lua

1
2
3
4
5
6
system.bindMouse("Sperer", true);
function eventMouse(player, x, y)
if (player == "Sperer") then
tfm.exec.addShamanObject(24, x, y);
end
end

Dernière modification le 1515442680000
Mmeelloooo
« Citoyen »
1515620640000
    • Mmeelloooo#0000
    • Profil
    • Derniers messages
#478
  0
Nettoork a dit :
Roxyrockster a dit :
um script que o rato cuspa um bloco de lava

Tentei fazer um ai pra você ... kkkkk

-- (Utilize a tecla [E] para tacar seu bloco de lava)

function eventNewPlayer(name)
system.bindKeyboard(name, 69, false)
end
for name in pairs(tfm.get.room.playerList) do
eventNewPlayer(name)
end
n=1
function eventKeyboard(name,key,down,x,y)
if key == 69 then
n = n + 1
if tfm.get.room.playerList[name].isFacingRight then
tfm.exec.addPhysicObject(n,x+57,y,{type=14,width=5,height=5,restitution=30.0,miceCollision=false})
tfm.exec.addPhysicObject(n+1,x+68,y-30,{type=3,width=20,height=20,dynamic=true,restitution=30.0,angle=70})
else
tfm.exec.addPhysicObject(n,x-57,y,{type=14,width=5,height=5,restitution=30.0,miceCollision=false})
tfm.exec.addPhysicObject(n+1,x-68,y-30,{type=3,width=20,height=20,dynamic=true,restitution=30.0,angle=-70})
end
tfm.exec.removePhysicObject(n-4)
end
end

Nossa, muito obrigada, mas alguem tem script de chao e lava?
Bolodefchoco
« Sénateur »
1515621900000
    • Bolodefchoco#0095
    • Profil
    • Derniers messages
    • Tribu
#479
  0
Mmeelloooo a dit :
Nettoork a dit :
Roxyrockster a dit :
um script que o rato cuspa um bloco de lava

Tentei fazer um ai pra você ... kkkkk

-- (Utilize a tecla [E] para tacar seu bloco de lava)

function eventNewPlayer(name)
system.bindKeyboard(name, 69, false)
end
for name in pairs(tfm.get.room.playerList) do
eventNewPlayer(name)
end
n=1
function eventKeyboard(name,key,down,x,y)
if key == 69 then
n = n + 1
if tfm.get.room.playerList[name].isFacingRight then
tfm.exec.addPhysicObject(n,x+57,y,{type=14,width=5,height=5,restitution=30.0,miceCollision=false})
tfm.exec.addPhysicObject(n+1,x+68,y-30,{type=3,width=20,height=20,dynamic=true,restitution=30.0,angle=70})
else
tfm.exec.addPhysicObject(n,x-57,y,{type=14,width=5,height=5,restitution=30.0,miceCollision=false})
tfm.exec.addPhysicObject(n+1,x-68,y-30,{type=3,width=20,height=20,dynamic=true,restitution=30.0,angle=-70})
end
tfm.exec.removePhysicObject(n-4)
end
end

Nossa, muito obrigada, mas alguem tem script de chao e lava?

The floor is lava, por Osicat
Mmeelloooo
« Citoyen »
1515623580000
    • Mmeelloooo#0000
    • Profil
    • Derniers messages
#480
  0
Bolodefchoco a dit :
Mmeelloooo a dit :
Nettoork a dit :
Roxyrockster a dit :
um script que o rato cuspa um bloco de lava

Tentei fazer um ai pra você ... kkkkk

-- (Utilize a tecla [E] para tacar seu bloco de lava)

function eventNewPlayer(name)
system.bindKeyboard(name, 69, false)
end
for name in pairs(tfm.get.room.playerList) do
eventNewPlayer(name)
end
n=1
function eventKeyboard(name,key,down,x,y)
if key == 69 then
n = n + 1
if tfm.get.room.playerList[name].isFacingRight then
tfm.exec.addPhysicObject(n,x+57,y,{type=14,width=5,height=5,restitution=30.0,miceCollision=false})
tfm.exec.addPhysicObject(n+1,x+68,y-30,{type=3,width=20,height=20,dynamic=true,restitution=30.0,angle=70})
else
tfm.exec.addPhysicObject(n,x-57,y,{type=14,width=5,height=5,restitution=30.0,miceCollision=false})
tfm.exec.addPhysicObject(n+1,x-68,y-30,{type=3,width=20,height=20,dynamic=true,restitution=30.0,angle=-70})
end
tfm.exec.removePhysicObject(n-4)
end
end

Nossa, muito obrigada, mas alguem tem script de chao e lava?

The floor is lava, por Osicat

Obrigada!
  • Forums
  • /
  • Transformice
  • /
  • Archives
  • /
  • Seção Editor de Mapas e Modules
  • /
  • [Lua] Peça scripts aqui!
« ‹ 24 / 133 › »
© Atelier801 2018

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

Version 1.27