feat(lua-games): полный паритет для игры 6 «Цветные плитки»

JS-версия:
- 36 плиток 6×6, серые
- ui.score = painted, ui.showText
- onMessage 'paint' → score++ + pickup sound + при 36 победа+win+confetti
- tile: onTouch → setColor зелёный + broadcast 'paint'

Lua-версия:
- ScreenGui+TextLabel 'Плитки: N / 36' счётчик
- __rbxl_show_text подсказка + 'Победа!'
- BindableEvent TilePainted
- 36 g6_tile_N: Touched → part.Color=зелёный + ev:Fire (painted-флаг)
- g6_main: painted++/label.Text/pickup Sound; при 36 — win+confetti
This commit is contained in:
min 2026-06-09 17:24:48 +03:00
parent f7074f5cd7
commit 8eec59af53

View File

@ -412,25 +412,71 @@ end)`,
// ═══════════════════════════════════════════════════════════════ // ═══════════════════════════════════════════════════════════════
// ИГРА 6 — «Угадай цвет» // ИГРА 6 — «Угадай цвет»
// ═══════════════════════════════════════════════════════════════ // ═══════════════════════════════════════════════════════════════
'color-tiles': { 'color-tiles': (function() {
g6_main: `-- === ИГРА «УГАДАЙ ЦВЕТ» — главный скрипт (Lua) === const overrides = {
g6_main: `-- === ИГРА «ЦВЕТНЫЕ ПЛИТКИ» — главный скрипт (Lua) ===
${SNIPPET_BROADCAST} ${SNIPPET_BROADCAST}
local colors = { "red", "green", "blue", "yellow" } local Players = game:GetService("Players")
local target = colors[math.random(1, #colors)] local player = Players.LocalPlayer
print("Встань на плитку цвета: " .. target) local painted = 0
local TOTAL = 36
local won = false
local ev = getEvent("TileStepped") __rbxl_show_text("Наступи на все плитки!", 3)
ev.Event:Connect(function(color)
if color == target then -- Счётчик в правом верхнем углу
print("Верно! +1 очко") local screenGui = Instance.new("ScreenGui", player.PlayerGui)
target = colors[math.random(1, #colors)] local label = Instance.new("TextLabel", screenGui)
print("Теперь встань на: " .. target) label.Size = UDim2.new(0, 220, 0, 50)
else label.Position = UDim2.new(1, -240, 0, 20)
print("Неверно! Нужен " .. target) label.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
label.BackgroundTransparency = 0.4
label.TextColor3 = Color3.fromRGB(160, 255, 160)
label.TextScaled = true
label.Font = Enum.Font.SourceSansBold
label.Text = "Плитки: 0 / " .. TOTAL
local pickupSound = Instance.new("Sound", workspace)
pickupSound.SoundId = "pickup"; pickupSound.Volume = 0.7
local winSound = Instance.new("Sound", workspace)
winSound.SoundId = "win"; winSound.Volume = 1
local paintEvent = getEvent("TilePainted")
paintEvent.Event:Connect(function()
if won then return end
painted = painted + 1
label.Text = "Плитки: " .. painted .. " / " .. TOTAL
pickupSound:Play()
if painted >= TOTAL then
won = true
winSound:Play()
__rbxl_show_text("Победа! Все плитки раскрашены!", 5)
local px = __rbxl_player_x()
local py = __rbxl_player_y()
local pz = __rbxl_player_z()
__rbxl_spawn_particles("confetti", px, py + 3, pz, 3, 3)
end end
end)`, end)`,
}, };
// Скрипт для каждой из 36 плиток — одинаковый код через генератор
const tileScript = `-- === Скрипт цветной плитки (Lua) ===
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local part = script.Parent
local painted = false
part.Touched:Connect(function(hit)
if painted then return end
local h = hit.Parent and hit.Parent:FindFirstChild("Humanoid")
if not h then return end
painted = true
part.Color = Color3.fromRGB(51, 221, 85) -- ярко-зелёный
local ev = ReplicatedStorage:FindFirstChild("TilePainted")
if ev then ev:Fire() end
end)`;
for (let i = 1; i <= 36; i++) overrides['g6_tile_' + i] = tileScript;
return overrides;
})(),
// ═══════════════════════════════════════════════════════════════ // ═══════════════════════════════════════════════════════════════
// ИГРА 7 — «Ловишка предметов» // ИГРА 7 — «Ловишка предметов»