×

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
  • /
  • Códigos útiles de LUA.
« ‹ 4 / 4
Códigos útiles de LUA.
Midoriya
« Citoyen »
1568257380000
    • Midoriya#2232
    • Profil
    • Derniers messages
#61
  1
quien me da codigos porfa
Mabel
« Citoyen »
1586354520000
    • Mabel#4194
    • Profil
    • Derniers messages
    • Tribu
#62
  0
Cual es el Comando del sorteos :V
Hector
« Citoyen »
1589795520000
    • Hector#1014
    • Profil
    • Derniers messages
    • Tribu
#63
  0
Quien me puede decir el LUA para los sorteos que se me quito al cambiarme de tribu
Goyeta
« Citoyen »
1590712200000
    • Goyeta#3887
    • Profil
    • Derniers messages
    • Tribu
#64
  0
Mabel a dit :
Cual es el Comando del sorteos :V

lo encontraste?
Factral
« Citoyen »
1609008000000
    • Factral#0000
    • Profil
    • Derniers messages
    • Tribu
#65
  3
dejo aqui un pequeño script en el que he re-hecho dodge un minijuego hecho en lua :3

link: https://pastebin.com/raw/X0EXywLv

para copiar dale Ctrl + a
Jefazo
« Citoyen »
1635219240000
    • Jefazo#7616
    • Profil
    • Derniers messages
#66
  0
Hola, disculpen, no hay algo para hacer a los ratones transparentes? Me estorban un poco al momento de jugar
Shalon
« Consul »
1635369060000
    • Shalon#0839
    • Profil
    • Derniers messages
#67
  1
Hola disculpen cuáles comandos.
Shalon
« Consul »
1635369060000
    • Shalon#0839
    • Profil
    • Derniers messages
#68
  1
???????
Blalolko
« Citoyen »
1637904000000
    • Blalolko#8166
    • Profil
    • Derniers messages
    • Tribu
#69
  0
Jefazo a dit :
Hola, disculpen, no hay algo para hacer a los ratones transparentes? Me estorban un poco al momento de jugar

Puedes usar el comando /watch [Nombre#tag] (Pones tu nombre y tu tag)
Aysla
« Citoyen »
1639470900000
    • Aysla#1979
    • Profil
    • Derniers messages
#70
  0
thx :)
Asaf0202
« Citoyen »
1656803160000
    • Asaf0202#0000
    • Profil
    • Derniers messages
#71
  0
Cómo hacer 2 llaves? editar: y también cómo activar habilidades en modo cham
Deletedaccount
« Citoyen »
1656807240000
    • Deletedaccount#6153
    • Profil
    • Derniers messages
    • Tribu
#72
  0
Asaf0202 a dit :
Cómo hacer 2 llaves? editar: y también cómo activar habilidades en modo cham

Necesitaré más detalle para atender tu primera petición ^^

Respecto a la segunda, actualmente no es posible activar o desactivar habilidades específicas para el chamán, sin embargo, puedes (des)habilitar TODAS las habilidades del chamán con la función tfm.exec.disableAllShamanSkills(). Puede encontrar más detalles en la documentación.
Asaf0202
« Citoyen »
1656855300000
    • Asaf0202#0000
    • Profil
    • Derniers messages
#73
  0
Indexinel a dit :
Asaf0202 a dit :
Cómo hacer 2 llaves? editar: y también cómo activar habilidades en modo cham

Necesitaré más detalle para atender tu primera petición ^^

Respecto a la segunda, actualmente no es posible activar o desactivar habilidades específicas para el chamán, sin embargo, puedes (des)habilitar TODAS las habilidades del chamán con la función tfm.exec.disableAllShamanSkills(). Puede encontrar más detalles en la documentación.

Gracias por la respuesta necesaria. Todavía puede obtener ayuda del hilo de discusión y ayuda de Lua. Le permito hacer preguntas sobre el tema, pero esto es colaborativo.
Popet5
« Citoyen »
1725647340000
    • Popet5#0000
    • Profil
    • Derniers messages
#74
  0
algun codigo para matar o quitar del mapa a un jugador o jugadores?
Illuminet
1727100720000
    • Illuminet#0000
    • Profil
    • Derniers messages
#75
[Modéré par Stargazing, raison : Código hecho con Inteligencia Artificial.]

Dernière modification le 1727101080000
Nezushin
« Citoyen »
1727403180000
    • Nezushin#9359
    • Profil
    • Derniers messages
    • Tribu
#76
  0
Illuminet a dit :




El de sorteo que pedían más arriba algo complejo pero dejo la explicación de cada cosa del script

Nunca va a ejecutar. Las funciones no existen, tiene error de sintáxis y un bucle infinito.

Dernière modification le 1727711460000
Jefedelsol
« Citoyen »
1742778180000
    • Jefedelsol#0000
    • Profil
    • Derniers messages
    • Tribu
#77
  0
hice como un pequeño minijuego, que trata que en el mapa se van generando (+1) (de defilante), y cada vez que agarras uno, te puede tocar un objeto: yunque, globo, nube, caja pequeña o caja grande, y ese objeto lo puedes invocar haciendo clic en el mapa con el propósito de pasarlo, aún no lo he probado con más personas

imagen
https://i.imgur.com/Px0LJ9o.png


código lua

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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
tfm.exec.newGame("@7966524", 0)
tfm.exec.disableAfkDeath(true)
tfm.exec.disableAutoNewGame(true)
tfm.exec.disableAutoShaman(true)
tfm.exec.disableAllShamanSkills(true)
tfm.exec.setGameTime(0, 1)
local max_bonus = 15
local bonus_c = 0

local codigos = { [1] = "Y", [2] = "N", [3] = "CP", [4] = "CG", [5] = "G", }

math.randomseed(os.time()) -- Números aleatorios
local i = 0
local jugadores = {}

function actualizarTexto(name)
ui.addTextArea(1, "<b><a href='event:example'>Yunques: "..jugadores[name]["Y"].."</a></b>", name, 10, 30, 90, 20, 0x6d2db5, 0x212F36, 0, true)
ui.addTextArea(2, "<b><a href='event:example'>Nubes: "..jugadores[name]["N"].."</a></b>", name, 100, 30, 70, 20, 0x6d2db5, 0x212F36, 0, true)
ui.addTextArea(3, "<b><a href='event:example'>Cajas pequeñas: "..jugadores[name]["CP"].."</a></b>", name, 180, 30, 130, 20, 0x6d2db5, 0x212F36, 0, true)
ui.addTextArea(4, "<b><a href='event:example'>Cajas grandes: "..jugadores[name]["CG"].."</a></b>", name, 320, 30, 130, 20, 0x6d2db5, 0x212F36, 0, true)
ui.addTextArea(5, "<b><a href='event:example'>Globos: "..jugadores[name]["G"].."</a></b>", name, 460, 30, 80, 20, 0x6d2db5, 0x212F36, 0, true)
end

function inicializarPartida(name)
-- N = Nube, Y = Yunque, CP = Caja Pequeña, CG = Caja Grande, G = Globo
jugadores[name] = {N=0,Y=0,CP=0,CG=0,G=0,S="Y"}
system.bindMouse(name, true)
ui.addTextArea(6, "", name, 10, 30, 520, 20, 0x6d2db5, 0x212F36, 1, true)
ui.addTextArea(7, "<b>S: ".. jugadores[name]["S"].."</b>", name, 10, 60, 40, 20, 0x6d2db5, 0x212F36, 1, true)
actualizarTexto(name)
tfm.exec.setShaman(name, false)
end

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

function eventNewPlayer(name)
inicializarPartida(name)
end

function eventPlayerBonusGrabbed(playerName, bonusId)
bonus_c = bonus_c - 1
local str = seleccionarObjetoChaman()
print(str)
jugadores[playerName][str] = jugadores[playerName][str] + 1
actualizarTexto(playerName)
end

function eventMouse(playerName, xMousePosition, yMousePosition)
local obj = jugadores[playerName]["S"]

if (jugadores[playerName][obj] < 1) then
--No le quedan puntos
else
jugadores[playerName][obj] = jugadores[playerName][obj] - 1
actualizarTexto(playerName)
local obj_id = seleccionarObjetoChamanID(obj)
tfm.exec.addShamanObject(obj_id, xMousePosition, yMousePosition, 0, 0, 0, false)
end
end

function seleccionarObjetoChaman()
local random_no = math.random(1,5)
return codigos[random_no]
end

function seleccionarObjetoChamanID(nombre)
if(nombre == "CP") then
return 1
elseif(nombre == "CG") then
return 2
elseif(nombre == "Y") then
return 10
elseif(nombre == "G") then
return math.random(28,31)
elseif(nombre == "N") then
return 57
end
end

local x = 0
local pos_x = 0
local pos_y = 0

function eventLoop(timeRemaining, timeRemaining)
if (x < 5) then
x = x + 1
elseif (x == 5) then
if(bonus_c < max_bonus) then -- colocar primero este(?
local select_area = math.random(1,2)
if (select_area == 1) then
pos_x = math.random(50,400)
pos_y = math.random(100,200)
elseif (select_area == 2) then
pos_x = math.random(600,1000)
pos_y = math.random(50,200)
end
bonus_c = bonus_c + 1
tfm.exec.addBonus(0, pos_x, pos_y, 10, 0, true)
x=0
end
end
end

function eventTextAreaCallback(textAreaID, playerName, callback)
if (codigos[textAreaID]) then
jugadores[playerName]["S"] = codigos[textAreaID]
end

ui.addTextArea(7, "<b>S: ".. jugadores[playerName]["S"].."</b>", playerName, 10, 60, 40, 20, 0x6d2db5, 0x212F36, 1, true)
end

function eventPlayerDied(playerName)
tfm.exec.respawnPlayer(playerName)
end
Flora
« Citoyen »
1746869820000
    • Flora#9543
    • Profil
    • Derniers messages
    • Tribu
#78
  0
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
26
27
28
29
30
31
32
33
34
35
36
37
38
local maps = {}

function eventLoop(elapsedTime, timeRemaining)
if elapsedTime >= 3000 then
tfm.exec.newGame("#38")
end
end

function eventNewGame()
maps[tfm.get.room.currentMap] = false

local xmlInfo = tfm.get.room.xmlMapInfo
if not xmlInfo or not xmlInfo.xml then
return
end

local xml = xmlInfo.xml
for tag in xml:gmatch("<S.->") do
local p = tag:match('P="([^"]+)"')
if p then
local values = {}
for v in p:gmatch("[^,]+") do
table.insert(values, tonumber(v))
end

local friction = values[3]
if friction == 0.01 then
print("<V>" .. tfm.get.room.currentMap .. "</V> - <ROSE>".. tfm.get.room.xmlMapInfo.author .."</ROSE>")
maps[tfm.get.room.currentMap] = true
return
end
end
end
end

tfm.exec.disableAfkDeath(true)
tfm.exec.disableAutoNewGame(true)
tfm.exec.disableAutoTimeLeft(true)
Sebastianuw
« Citoyen »
1788368520000
    • Sebastianuw#3294
    • Profil
    • Derniers messages
    • Tribu
#79
  0
-- ===================================================
-- MODULO LUA OFICIAL: STOP MULTIJUGADOR (CLEAN CODE)
-- ===================================================

tfm.exec.disableAutoShaman(true)
tfm.exec.disableAutoNewGame(true)
tfm.exec.disableAutoScore(true)

local CONFIG = {
TIEMPO_RONDA = 120,
TIEMPO_REVISION = 15,
CATEGORIAS = {"Nombre", "Animal", "Fruta/Verdura", "Color", "País/Ciudad", "Objeto"},
ABECEDARIO = {"A","B","C","D","E","F","G","H","I","J","L","M","N","O","P","Q","R","S","T","U","V"}
}

local M = {
estado = "INICIO",
letra = "",
tiempoRestante = 0,
tiempoRevision = 0,
jugadorStop = "",
respuestas = {},
invalidadas = {},
puntajes = {},
popupAbierto = {}
}

local function limpiarUI(p)
for i = 1, 60 do
ui.removeTextArea(i, p)
end
end

local function getBanderaPath(p)
local player = tfm.get.room.playerList


local comm = (player and player.community) or "en"
return "x_transformice/x_flags/" .. string.lower(comm) .. ".png"
end

local function mostrarPantallaInicio(p)
limpiarUI(p)
M.estado = "INICIO"

ui.addTextArea(1, "", p, 0, 0, 800, 400, 0x0F172A, 0x0F172A, 1.0, true)
ui.addTextArea(2, "", p, 80, 30, 640, 340, 0x1E293B, 0x334155, 0.95, true)
ui.addTextArea(3, "<p align='center'><font size='30' color='#FF2E63'><b>STOP MULTIJUGADOR</b></font></p>", p, 100, 50, 600, 45, 0x000000, 0x000000, 0.0, true)

local msj = "<p align='center'><font size='13' color='#E2E8F0'>"
msj = msj .. "<b>¡Bienvenido al sistema de STOP oficial!</b><br/><br/>"
msj = msj .. "1. Responde a las <b>6 categorías</b> asignadas.<br/>"
msj = msj .. "2. Completa la lista para habilitar el botón de <b>STOP</b>.<br/>"
msj = msj .. "3. Fase de revisión: Vota para anular respuestas incorrectas (✕).<br/>"
msj = msj .. "4. Sistema de puntuación automatizado sin lag de servidor.<br/></font></p>"

ui.addTextArea(4, msj, p, 120, 110, 560, 150, 0x0F172A, 0x1E293B, 0.8, true)
ui.addTextArea(5, "<p align='center'><font size='16' color='#FFFFFF'><a href='event:iniciar'><b>[ INICIAR PARTIDA ]</b></a></font></p>", p, 280, 280, 240, 38, 0x00ADB5, 0x38BDF8, 1, true)
end

function nuevaRonda()
M.estado = "JUGANDO"
limpiarUI(nil)

M.letra = CONFIG.ABECEDARIO[math.random(#CONFIG.ABECEDARIO)]
M.tiempoRestante = CONFIG.TIEMPO_RONDA
M.jugadorStop = ""
M.popupAbierto = {}
M.invalidadas = {}
M.respuestas = {}

for name in pairs(tfm.get.room.playerList) do
M.respuestas[name] = {}
M.invalidadas[name] = {}
M.popupAbierto[name] = false
if not M.puntajes[name] then M.puntajes[name] = 0 end
end

tfm.exec.playSound("cite/style1.mp3", 100, nil, nil, nil)
tfm.exec.chatMessage("<J><b>[STOP] ¡Nueva ronda! Letra: " .. M.letra .. "</b></J>", nil)
dibujarInterfazCompleta()
end

function dibujarInterfazCompleta()
if M.estado ~= "JUGANDO" and M.estado ~= "STOP_PRESIONADO" then return end

for p in pairs(tfm.get.room.playerList) do
if not M.popupAbierto

then
ui.addTextArea(1, "", p, 0, 0, 800, 400, 0x0F172A, 0x0F172A, 1.0, true)

local header = "<font size='18' color='#FF2E63'><b>LETRA: " .. M.letra .. "</b></font> <font size='14' color='#94A3B8'>|</font> "
header = header .. "<font size='15' color='#FFFFFF'>Tiempo: <b>" .. M.tiempoRestante .. "s</b></font>"
ui.addTextArea(2, "<p align='center'>" .. header .. "</p>", p, 230, 40, 340, 45, 0x1E293B, 0xFF2E63, 0.95, true)

ui.addTextArea(3, "<b>CATEGORÍAS:</b>", p, 30, 40, 180, 45, 0x1E293B, 0x38BDF8, 0.9, true)

local contestadas = 0
for i, cat in ipairs(CONFIG.CATEGORIAS) do
local resp = (M.respuestas

and M.respuestas

) or "<i>Clic para responder</i>"
local colorTexto = "#94A3B8"

if M.respuestas

and M.respuestas

then
colorTexto = "#38BDF8"
contestadas = contestadas + 1
end

local btnText = string.format("<b>%d. %s:</b> <font color='%s'>%s</font>", i, cat, colorTexto, resp)
ui.addTextArea(10 + i, "<a href='event:cat_" .. i .. "'>" .. btnText .. "</a>", p, 30, 95 + ((i-1) * 38), 340, 32, 0x1E293B, 0x334155, 0.9, true)
end

if contestadas == #CONFIG.CATEGORIAS then
ui.addTextArea(25, "<p align='center'><font size='22' color='#FFFFFF'><a href='event:presionar_stop'><b>¡ STOP !</b></a></font></p>", p, 480, 285, 220, 50, 0xFF2E63, 0xFFFFFF, 1, true)
else
local restantes = #CONFIG.CATEGORIAS - contestadas
ui.addTextArea(25, string.format("<p align='center'><font size='13' color='#64748B'><b>Faltan %d respuestas<br/>para cantar STOP</b></font></p>", restantes), p, 480, 285, 220, 50, 0x1E293B, 0x334155, 0.9, true)
end
end
end
end

function iniciarFaseRevision()
M.estado = "REVISION"
M.tiempoRevision = CONFIG.TIEMPO_REVISION
limpiarUI(nil)

tfm.exec.playSound("transformice/audio/shamanAnvil.mp3", 100, nil, nil, nil)
tfm.exec.chatMessage("<CV><b>[REVISIÓN] Vota anulando respuestas incorrectas.</b></CV>", nil)
dibujarMenuRevision()
end

function dibujarMenuRevision()
if M.estado ~= "REVISION" then return end

ui.addTextArea(1, "", nil, 0, 0, 800, 400, 0x0F172A, 0x0F172A, 1.0, true)
ui.addTextArea(2, "<p align='center'><font size='15' color='#FFD369'><b>FASE DE REVISIÓN (" .. M.tiempoRevision .. "s)</b></font></p>", nil, 100, 10, 600, 30, 0x1E293B, 0xFFD369, 0.9, true)

local totalJugadores = 0
for _ in pairs(tfm.get.room.playerList) do totalJugadores = totalJugadores + 1 end

local anchoCol = math.floor(740 / math.max(1, totalJugadores))
local startX = 30
local pIndex = 0

for targetName in pairs(tfm.get.room.playerList) do
local posX = startX + (pIndex * anchoCol)

ui.addTextArea(100 + pIndex, "<p align='center'><b>" .. targetName .. "</b></p>", nil, posX, 50, anchoCol - 5, 25, 0x334155, 0x38BDF8, 0.9, true)
tfm.exec.addImage(getBanderaPath(targetName), "&1", posX + 5, 55, nil)

for cIdx, catName in ipairs(CONFIG.CATEGORIAS) do
local resp = (M.respuestas[targetName] and M.respuestas[targetName][cIdx]) or "---"
local idArea = 2000 + (pIndex * 10) + cIdx
local esInvalida = M.invalidadas[targetName] and M.invalidadas[targetName][cIdx]

local fmtTexto = ""
if resp == "---" then
fmtTexto = "<font color='#64748B'><i>Sin resp.</i></font>"
elseif esInvalida then
fmtTexto = "<a href='event:toggle_" .. targetName .. "_" .. cIdx .. "'><font color='#FF2E63'><s>" .. resp .. "</s> ✕</font></a>"
else
fmtTexto = "<a href='event:toggle_" .. targetName .. "_" .. cIdx .. "'><font color='#00ADB5'>" .. resp .. "</font></a>"
end

local contenido = "<b>" .. cIdx .. ". " .. catName:sub(1,6) .. ":</b><br/>" .. fmtTexto
ui.addTextArea(idArea, contenido, nil, posX, 80 + ((cIdx - 1) * 48), anchoCol - 5, 44, 0x1E293B, 0x475569, 0.9, true)
end

pIndex = pIndex + 1
end
end

function eventTextAreaCallback(id, p, cb)
if cb == "iniciar" then
nuevaRonda()
elseif cb == "presionar_stop" and M.estado == "JUGANDO" then
local contestadas = 0
if M.respuestas

then
for i = 1, #CONFIG.CATEGORIAS do
if M.respuestas

then contestadas = contestadas + 1 end
end
end

if contestadas == #CONFIG.CATEGORIAS then
M.jugadorStop = p
tfm.exec.playSound("transformice/audio/donneFromage.mp3", 100, nil, nil, nil)
tfm.exec.chatMessage("<R><b>¡" .. p .. " CANTÓ STOP!</b></R>", nil)
iniciarFaseRevision()
end
elseif cb:sub(1, 4) == "cat_" and (M.estado == "JUGANDO" or M.estado == "STOP_PRESIONADO") then
local catIndex = tonumber(cb:sub(5))
if catIndex then
M.popupAbierto

= true
ui.addPopup(catIndex, 2, "Palabra con letra " .. M.letra .. " para " .. CONFIG.CATEGORIAS[catIndex] .. ":", p, 420, 100, 260, true)
end
elseif cb:sub(1, 7) == "toggle_" and M.estado == "REVISION" then
local params = {}
for part in cb:gmatch("[^_]+") do table.insert(params, part) end

local targetName = params[2]
local cIdx = tonumber(params[3])

if targetName and cIdx and M.respuestas[targetName] and M.respuestas[targetName][cIdx] then
if not M.invalidadas[targetName] then M.invalidadas[targetName] = {} end
M.invalidadas[targetName][cIdx] = not M.invalidadas[targetName][cIdx]
dibujarMenuRevision()
end
end
end

function eventPopupAnswer(id, p, respuesta)
M.popupAbierto

= false
if M.estado ~= "JUGANDO" and M.estado ~= "STOP_PRESIONADO" then return end

local index = id
if index and index >= 1 and index <= #CONFIG.CATEGORIAS and respuesta ~= "" then
if not M.respuestas

then M.respuestas

= {} end

local val = respuesta:match("^%s*(.-)%s*$")
local primeraLetra = string.upper(string.sub(val, 1, 1))

if primeraLetra == string.upper(M.letra) then
M.respuestas

[index] = val
tfm.exec.playSound("transformice/audio/squeak.mp3", 100, nil, p, nil)
else
tfm.exec.chatMessage("<R>✕ Debe empezar por la letra <b>" .. M.letra .. "</b>.</R>", p)
end
end
dibujarInterfazCompleta()
end

function eventLoop(t, r)
if M.estado == "JUGANDO" or M.estado == "STOP_PRESIONADO" then
if t % 1000 < 500 then
M.tiempoRestante = M.tiempoRestante - 1
if M.tiempoRestante <= 0 then
iniciarFaseRevision()
else
for p in pairs(tfm.get.room.playerList) do
if not M.popupAbierto

then
local header = "<font size='18' color='#FF2E63'><b>LETRA: " .. M.letra .. "</b></font> <font size='14' color='#94A3B8'>|</font> <font size='15' color='#FFFFFF'>Tiempo: <b>" .. M.tiempoRestante .. "s</b></font>"
ui.addTextArea(2, "<p align='center'>" .. header .. "</p>", p, 230, 40, 340, 45, 0x1E293B, 0xFF2E63, 0.95, true)
end
end
end
end
elseif M.estado == "REVISION" then
if t % 1000 < 500 then
M.tiempoRevision = M.tiempoRevision - 1
if M.tiempoRevision <= 0 then
finalizarRonda()
else
ui.addTextArea(2, "<p align='center'><font size='15' color='#FFD369'><b>FASE DE REVISIÓN (" .. M.tiempoRevision .. "s)</b></font></p>", nil, 100, 10, 600, 30, 0x1E293B, 0xFFD369, 0.9, true)
end
end
end
end

function finalizarRonda()
M.estado = "RESULTADOS"
M.popupAbierto = {}
limpiarUI(nil)

ui.addTextArea(1, "", nil, 0, 0, 800, 400, 0x0F172A, 0x0F172A, 1.0, true)

local puntosRonda = {}
for name in pairs(tfm.get.room.playerList) do puntosRonda[name] = 0 end

for i = 1, #CONFIG.CATEGORIAS do
local recuentos = {}
for name, resp in pairs(M.respuestas) do
local esAnulada = M.invalidadas[name] and M.invalidadas[name]
if resp and not esAnulada then
local pLimpia = string.lower(resp:match("^%s*(.-)%s*$"))
recuentos[pLimpia] = (recuentos[pLimpia] or 0) + 1
end
end

for name, resp in pairs(M.respuestas) do
local esAnulada = M.invalidadas[name] and M.invalidadas[name]
if resp and not esAnulada then
local pLimpia = string.lower(resp:match("^%s*(.-)%s*$"))
if recuentos[pLimpia] == 1 then
puntosRonda[name] = puntosRonda[name] + 100
else
puntosRonda[name] = puntosRonda[name] + 50
end
end
end
end

for name, pts in pairs(puntosRonda) do
M.puntajes[name] = (M.puntajes[name] or 0) + pts
tfm.exec.setPlayerScore(name, M.puntajes[name], false)
end

local resText = "<p align='center'><font size='20' color='#FF2E63'><b>RESULTADOS - STOP MULTIJUGADOR</b></font></p><br/>"
resText = resText .. "<b>Puntuación de la ronda:</b><br/>"
for name, pts in pairs(puntosRonda) do
resText = resText .. "• <b>" .. name .. ":</b> +" .. pts .. " pts | Total: <b>" .. M.puntajes[name] .. " pts</b><br/>"
end

resText = resText .. "<br/><p align='center'><font color='#38BDF8'><a href='event:iniciar'><b>[ JUGAR OTRA RONDA ]</b></a></font></p>"
ui.addTextArea(2, resText, nil, 150, 40, 500, 300, 0x1E293B, 0x38BDF8, 0.95, true)
end

function eventNewPlayer(p)
system.bindMouse(p, true)
if M.estado == "INICIO" then
mostrarPantallaInicio(p)
elseif M.estado == "JUGANDO" then
M.respuestas

= {}
M.invalidadas

= {}
M.popupAbierto

= false
M.puntajes

= 0
dibujarInterfazCompleta()
end
end

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

mostrarPantallaInicio(nil)

  • Forums
  • /
  • Transformice
  • /
  • Modules
  • /
  • Códigos útiles de LUA.
« ‹ 4 / 4
© Atelier801 2018

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

Version 1.27