From 5aec627b179f30cadb95e5f7c8f1ffbf5b3c40bb Mon Sep 17 00:00:00 2001 From: min Date: Tue, 9 Jun 2026 21:37:05 +0300 Subject: [PATCH] =?UTF-8?q?feat(g24):=20=D0=BF=D0=BE=D0=BB=D0=BD=D1=8B?= =?UTF-8?q?=D0=B9=20=D0=BF=D0=B0=D1=80=D0=B8=D1=82=D0=B5=D1=82=20=C2=AB?= =?UTF-8?q?=D0=9F=D0=B0=D0=B4=D0=B0=D1=8E=D1=89=D0=B8=D0=B9=20=D0=BC=D0=BE?= =?UTF-8?q?=D1=81=D1=82=C2=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit JS: - showText 'Беги по мосту — доски рушатся!' - onTick: p.y < -3 → respawn + 'Упал в пропасть! Снова.' + lose - onMessage 'win' → 'Победа!' + win + confetti - 18 досок: onTouch → click sound + delete через 1с - финиш: onTouch → broadcast 'win' Lua (паритет): - __rbxl_show_text + Sounds - Heartbeat: player_y < -3 → LoadCharacter + lose - BindableEvent WinReached - g24_plank_1..18: единый скрипт (IIFE генерит 18 ключей): Touched → click Sound + Debris:AddItem(part, 1) - g24_finish: Touched → WinReached:Fire (fired-флаг) --- src/community/docsGamesBuildersLua.js | 86 +++++++++++++++++++++++---- 1 file changed, 73 insertions(+), 13 deletions(-) diff --git a/src/community/docsGamesBuildersLua.js b/src/community/docsGamesBuildersLua.js index 95335a3..44438a3 100644 --- a/src/community/docsGamesBuildersLua.js +++ b/src/community/docsGamesBuildersLua.js @@ -2078,24 +2078,84 @@ end)`; // ═══════════════════════════════════════════════════════════════ // ИГРА 24 — «Падающий мост» // ═══════════════════════════════════════════════════════════════ - 'falling-bridge': { - g24_main: `-- === ИГРА «ПАДАЮЩИЙ МОСТ» (Lua) === -print("Беги по мосту — плиты падают!")`, - g24_plate: `-- === Скрипт падающей плиты (Lua) === + 'falling-bridge': (function() { + const TILES = 18; + const overrides = { + g24_main: `-- === ИГРА «ПАДАЮЩИЙ МОСТ» — главный скрипт (Lua) === +${SNIPPET_BROADCAST} + +local Players = game:GetService("Players") +local RunService = game:GetService("RunService") +local player = Players.LocalPlayer +local won = false + +__rbxl_show_text("Беги по мосту — доски рушатся!", 3) + +local loseSound = Instance.new("Sound", workspace) +loseSound.SoundId = "lose"; loseSound.Volume = 0.7 +local winSound = Instance.new("Sound", workspace) +winSound.SoundId = "win"; winSound.Volume = 1 + +-- Респаун при падении в пропасть +RunService.Heartbeat:Connect(function() + if won then return end + local py = __rbxl_player_y() + if py < -3 then + player:LoadCharacter() + __rbxl_show_text("Упал в пропасть! Снова.", 1.5) + loseSound:Play() + end +end) + +-- Финиш сообщает о победе +local winEvent = getEvent("WinReached") +winEvent.Event:Connect(function() + if won then return end + 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)`, + g24_finish: `-- === Скрипт финиша (Lua) === +local ReplicatedStorage = game:GetService("ReplicatedStorage") local part = script.Parent -local fell = false +local fired = false + part.Touched:Connect(function(hit) - if fell then return end + if fired then return end local h = hit.Parent and hit.Parent:FindFirstChild("Humanoid") if not h then return end - fell = true - task.delay(0.5, function() - part.Anchored = false - part.CanCollide = false - game:GetService("Debris"):AddItem(part, 3) - end) + fired = true + local ev = ReplicatedStorage:FindFirstChild("WinReached") + if ev then ev:Fire() end end)`, - }, + }; + // 18 досок — каждая при касании играет click и исчезает через 1с + const plankScript = `-- === Скрипт доски моста (Lua) === +local Debris = game:GetService("Debris") +local part = script.Parent +local cracking = false + +local clickSound = Instance.new("Sound", part) +clickSound.SoundId = "click"; clickSound.Volume = 0.5 + +part.Touched:Connect(function(hit) + if cracking then return end + local h = hit.Parent and hit.Parent:FindFirstChild("Humanoid") + if not h then return end + cracking = true + clickSound:Play() + -- через 1 секунду доска пропадает + Debris:AddItem(part, 1) +end)`; + for (let i = 1; i <= TILES; i++) { + overrides['g24_plank_' + i] = plankScript; + } + return overrides; + })(), // ═══════════════════════════════════════════════════════════════ // ИГРА 25 — «Облёт камеры»