×

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
  • /
  • [Pedidos e Exemplos] Mega Galeria LUA
1 / 30 › »
[Pedidos e Exemplos] Mega Galeria LUA
Rufflesdqjo
« Citoyen »
1417276140000
    • Rufflesdqjo#0095
    • Profil
    • Derniers messages
    • Tribu
#1
  0
Olá ratos e ratas!

Você precisa de algum código para implementar o seu mini-game? Está no lugar certo!

Nesse tópico, vocês poderão fazer pedidos de fragmentos de códigos para auxiliá-los na criação dos seus mini-games e outros códigos LUA.

Atentem-se a algumas regrinhas para evitar bagunça no tópico:

  • Não peça um código antes de receber uma resposta pelo seu último pedido.
  • Evite postagens de códigos muito grandes, use o pastebin caso seu código tenha mais de 20 linhas.

A postagem de exemplos de script está restrita apenas a códigos que sejam comuns em vários scripts, por exemplo:

Adicionando administradores a dit :

admin = {};
admin["Rufflesdqjo"] = 1;

function isAdmin (playerName)
return admin[playerName] ~= nil;
end

print(isAdmin("Rufflesdqjo"));

-- Saída no console:
-- True

Lembrem-se de reportar qualquer usuário que descumpra as regras acima e qualquer outra regra da seção modules.

Atenciosamente,

Equipe de Sentinelas BR.
Operop
« Citoyen »
1417276680000
    • Operop#0000
    • Profil
    • Derniers messages
#2
  0
Arrasou!
Bruno
« Censeur »
1417276920000
    • Bruno#3852
    • Profil
    • Derniers messages
    • Tribu
#3
  0
Arrasou sent bom!!!
Esh
1417277760000
    • Esh#0095
    • Profil
    • Derniers messages
    • Tribu
#4
[Modéré par Imaginemod]

Dernière modification le 1417346340000
Blablabladk
« Citoyen »
1417284960000
    • Blablabladk#0000
    • Profil
    • Derniers messages
#5
  0
muito obrigado! sent divo.

primeira pag.
Mathwarm
« Citoyen »
1417293780000
    • Mathwarm#0000
    • Profil
    • Derniers messages
    • Tribu
#6
  0
Vai ajudar muito! Firts page
Hydroper
« Citoyen »
1417294680000
    • Hydroper#0000
    • Profil
    • Derniers messages
    • Tribu
#7
  0
zzmacth a dit :
Arrasou sent bom!!!

operop a dit :
Arrasou!
Sla
« Censeur »
1417313580000
    • Sla#3700
    • Profil
    • Derniers messages
    • Tribu
#8
  0
Rotaçao de mapa e alguem vira vamp aleatoriamente
Gutigusta
« Citoyen »
1417317960000
    • Gutigusta#0000
    • Profil
    • Derniers messages
    • Tribu
#9
  0
Finalmente criaram esse tópico, era o que estava faltando na seção.
Rufflesdqjo
« Citoyen »
1417318680000
    • Rufflesdqjo#0095
    • Profil
    • Derniers messages
    • Tribu
#10
  0
luanpow a dit :
Rotaçao de mapa e alguem vira vamp aleatoriamente


--VAMPIRO ALEATÓRIO

function setPlayerList ()
players = {};
for p,_ in pairs (tfm.get.room.playerList) do
table.insert(players, p);
end
return players;
end

function shuffle (t)
local n = #t;

while (n >= 2) do
local k = math.random(n);
t[n], t[k] = t[k], t[n];
n = n - 1;
end

return t;
end

shuffle(setPlayerList());

tfm.exec.setVampirePlayer(players[math.random(#players)]);



--ROTAÇÃO DE MAPAS

maps = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};

mapCount = 0;

function eventLoop (timePassed, timeLeft)
if (timeLeft <= 0) then
mapCount = mapCount + 1;
if (mapCount > #maps) then
mapCount = 0;
end
tfm.exec.newGame(maps[mapCount]);
end
end

tfm.exec.disableAutoNewGame(true);
tfm.exec.newGame(maps[mapCount]);


Ta aí! ;)

Dernière modification le 1417319340000
Hydroper
« Citoyen »
1417340880000
    • Hydroper#0000
    • Profil
    • Derniers messages
    • Tribu
#11
  0
Ruffles PR0.
Esh
« Censeur »
1417346220000
    • Esh#0095
    • Profil
    • Derniers messages
    • Tribu
#12
  0
òtimo,como pedido, aqui estão os scripts do outro topico

Voar utilizando tecla de espaço
function eventNewPlayer(k)
tfm.exec.bindKeyboard(k,32,true,true)
end

function eventKeyboard(k,key,down,posX,posY)
if (key == 32) then
tfm.exec.movePlayer(k,0,0,false,0,-50,false)
end
end

for k,v in pairs(tfm.get.room.playerList) do
tfm.exec.bindKeyboard(k,32,true,true)
end


Jogador morrer e virar vampiro
function eventPlayerDied(k)
if not tfm.get.room.playerList[k].isVampire then
tfm.exec.respawnPlayer(k)
tfm.exec.setVampirePlayer(k)
end
end


Teleportar com clique de mouse
function eventNewPlayer(k)
system.bindMouse(k,true)
end

function eventMouse(k,posX,posY)
tfm.exec.displayParticle(37,tfm.get.room.playerList[k].x,tfm.get.room.playerList[k].y,0,0,0,0)
tfm.exec.movePlayer(k,posX,posY,false,0,0,false)
tfm.exec.displayParticle(36,posX,posY,0,0,0,0)
end

for k,v in pairs(tfm.get.room.playerList) do
system.bindMouse(k,true)
end


Pegar nome de jogador com clique do mouse
function eventNewPlayer(k)
system.bindMouse(k,true)
end

function eventMouse(k,posX,posY)
for k,v in pairs(tfm.get.room.playerList) do
if (v.x < posX+20 and v.x > posX-20 and v.y > posY-20 and v.y < posY+20) then
print('Jogador: '..k)
end
end
end

for k,v in pairs(tfm.get.room.playerList) do
system.bindMouse(k,true)
end


Cores aleatórias no nick
function eventLoop()
for k,v in pairs(tfm.get.room.playerList) do
tfm.exec.setNameColor(k,'0x'..math.random(0x000000,0xFFFFFF))
end
end


Ao jogador beijar,varios corações aparecerem
function eventEmotePlayed(k,id)
if (id == 3) then
for loop = 10,0,-1 do
tfm.exec.displayParticle(5,tfm.get.room.playerList[k].x,tfm.get.room.playerList[k].y,math.random(-1,1),math.random(-1,1),math.random(-0.21,0.21),math.random(-0.21,0.21))
end
end
end


Menu com textAreas

function eventTextAreaCallback(id, player,callback)
if (callback == 'fechar') then
for k = 3,0,-1 do ui.removeTextArea(k,player) end
end
end

function sendUi(title, text, player, x, y, width, height)
ui.addTextArea(0, string.format("<font size='14' face='Verdana' color='#009D9D'><b>%s</font>",title), player, x+width/2, y-28, width+4, height, 0x27373f, 0x27373f, 1, true);
ui.addTextArea(1, text, player, x+width/2+2, y, width, height-30, 0x324650, 0x324650, 1, true);
ui.addTextArea(2, '', player, width+171, y-26, 15, 15, 0x009D9D, 0x009D9D, 1, true);

ui.addTextArea(3, "<font color = '#324650' size='15'><B><a href='event:fechar'>X</a>", player, width+171, y-30, 15, nil, 0, 0, 1, true);
end

como usar: sendUi('<p align="center">Exemplo','Isto é um exemplo', nil, 0, 100, 370, 170, true)


Fogos de artificio

function eventLoop()
x = math.random(0,800)
y = math.random(0,400)
r = 50
ids = {13,0,4,2,11,9,8}
id = ids[math.random(#ids)]
for i = 1, 360 do
local angle = i * math.pi / 180
local ptx, pty = x + r * math.cos( angle ), y + r * math.sin( angle )
tfm.exec.displayParticle(id,ptx,pty,math.cos(angle),math.sin(angle),math.cos(angle),math.sin(angle))
end
end
Allantinaldo
« Citoyen »
1417350180000
    • Allantinaldo#0000
    • Profil
    • Derniers messages
#13
  0
Eu queria um script como se fosse uma loja , Que você comprasse Algo como ( Queijo , Virar Vamp ) Com os pontos que acumulou.
Temmye
« Citoyen »
1417351080000
    • Temmye#7657
    • Profil
    • Derniers messages
    • Tribu
#14
  0
Queria um script de morrer e vira esqueleto :)
Bruno
« Censeur »
1417352040000
    • Bruno#3852
    • Profil
    • Derniers messages
    • Tribu
#15
  0
Ruffles me da um código que faça printar oi
Esh
« Censeur »
1417353180000
    • Esh#0095
    • Profil
    • Derniers messages
    • Tribu
#16
  0
pylack a dit :
Queria um script de morrer e vira esqueleto :)

Não têm como fazer isso na api lua.
Apadrinhada
« Censeur »
1417354020000
    • Apadrinhada#0000
    • Profil
    • Derniers messages
    • Tribu
#17
  0
Partícula de chuva?
Esh
« Censeur »
1417355580000
    • Esh#0095
    • Profil
    • Derniers messages
    • Tribu
#18
  0
apadrinhada a dit :
Partícula de chuva?

function eventLoop()
for k = 20,0,-1 do
tfm.exec.displayParticle(14,math.random(0,800),math.random(50),0,math.random(1.1),0,math.random(0.22))
end
end


Têm esse aqui
Gatan
« Censeur »
1417357740000
    • Gatan#1201
    • Profil
    • Derniers messages
    • Tribu
#19
  0
Um script tipo o !draw do utility?
Sla
« Censeur »
1417363140000
    • Sla#3700
    • Profil
    • Derniers messages
    • Tribu
#20
  0
Rufflesdqjo a dit :
luanpow a dit :
Rotaçao de mapa e alguem vira vamp aleatoriamente


--VAMPIRO ALEATÓRIO

function setPlayerList ()
players = {};
for p,_ in pairs (tfm.get.room.playerList) do
table.insert(players, p);
end
return players;
end

function shuffle (t)
local n = #t;

while (n &gt;= 2) do
local k = math.random(n);
t[n], t[k] = t[k], t[n];
n = n - 1;
end

return t;
end

shuffle(setPlayerList());

tfm.exec.setVampirePlayer(players[math.random(#players)]);



--ROTAÇÃO DE MAPAS

maps = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};

mapCount = 0;

function eventLoop (timePassed, timeLeft)
if (timeLeft &lt;= 0) then
mapCount = mapCount + 1;
if (mapCount &gt; #maps) then
mapCount = 0;
end
tfm.exec.newGame(maps[mapCount]);
end
end

tfm.exec.disableAutoNewGame(true);
tfm.exec.newGame(maps[mapCount]);


Ta aí! ;)

vlw!
  • Forums
  • /
  • Transformice
  • /
  • Archives
  • /
  • Seção Editor de Mapas e Modules
  • /
  • [Pedidos e Exemplos] Mega Galeria LUA
1 / 30 › »
© Atelier801 2018

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

Version 1.27