From 8eec59af53976480f1f1fc4883b8994a6f1afaed Mon Sep 17 00:00:00 2001 From: min Date: Tue, 9 Jun 2026 17:24:48 +0300 Subject: [PATCH] =?UTF-8?q?feat(lua-games):=20=D0=BF=D0=BE=D0=BB=D0=BD?= =?UTF-8?q?=D1=8B=D0=B9=20=D0=BF=D0=B0=D1=80=D0=B8=D1=82=D0=B5=D1=82=20?= =?UTF-8?q?=D0=B4=D0=BB=D1=8F=20=D0=B8=D0=B3=D1=80=D1=8B=206=20=C2=AB?= =?UTF-8?q?=D0=A6=D0=B2=D0=B5=D1=82=D0=BD=D1=8B=D0=B5=20=D0=BF=D0=BB=D0=B8?= =?UTF-8?q?=D1=82=D0=BA=D0=B8=C2=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- src/community/docsGamesBuildersLua.js | 74 ++++++++++++++++++++++----- 1 file changed, 60 insertions(+), 14 deletions(-) diff --git a/src/community/docsGamesBuildersLua.js b/src/community/docsGamesBuildersLua.js index 216ef8c..8fb01b4 100644 --- a/src/community/docsGamesBuildersLua.js +++ b/src/community/docsGamesBuildersLua.js @@ -412,25 +412,71 @@ end)`, // ═══════════════════════════════════════════════════════════════ // ИГРА 6 — «Угадай цвет» // ═══════════════════════════════════════════════════════════════ - 'color-tiles': { - g6_main: `-- === ИГРА «УГАДАЙ ЦВЕТ» — главный скрипт (Lua) === + 'color-tiles': (function() { + const overrides = { + g6_main: `-- === ИГРА «ЦВЕТНЫЕ ПЛИТКИ» — главный скрипт (Lua) === ${SNIPPET_BROADCAST} -local colors = { "red", "green", "blue", "yellow" } -local target = colors[math.random(1, #colors)] -print("Встань на плитку цвета: " .. target) +local Players = game:GetService("Players") +local player = Players.LocalPlayer +local painted = 0 +local TOTAL = 36 +local won = false -local ev = getEvent("TileStepped") -ev.Event:Connect(function(color) - if color == target then - print("Верно! +1 очко") - target = colors[math.random(1, #colors)] - print("Теперь встань на: " .. target) - else - print("Неверно! Нужен " .. target) +__rbxl_show_text("Наступи на все плитки!", 3) + +-- Счётчик в правом верхнем углу +local screenGui = Instance.new("ScreenGui", player.PlayerGui) +local label = Instance.new("TextLabel", screenGui) +label.Size = UDim2.new(0, 220, 0, 50) +label.Position = UDim2.new(1, -240, 0, 20) +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)`, - }, + }; + // Скрипт для каждой из 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 — «Ловишка предметов»