diff --git a/src/community/docsGamesBuildersLua.js b/src/community/docsGamesBuildersLua.js index b06708b..216ef8c 100644 --- a/src/community/docsGamesBuildersLua.js +++ b/src/community/docsGamesBuildersLua.js @@ -377,14 +377,35 @@ end)`, // ═══════════════════════════════════════════════════════════════ 'maze': { g5_main: `-- === ИГРА «ЛАБИРИНТ» — главный скрипт (Lua) === -print("Найди выход из лабиринта!")`, - g5_finish: `-- === Финиш лабиринта (Lua) === +${SNIPPET_BROADCAST} + +__rbxl_show_text("Найди выход из лабиринта!", 3) + +local winSound = Instance.new("Sound", workspace) +winSound.SoundId = "win"; winSound.Volume = 1 + +local winEvent = getEvent("WinReached") +winEvent.Event:Connect(function() + __rbxl_show_text("Победа! Ты нашёл выход!", 5) + winSound:Play() + 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)`, + g5_finish: `-- === Скрипт финиша лабиринта (Lua) === +-- Висит на невидимой зоне над зелёным ковриком. +local ReplicatedStorage = game:GetService("ReplicatedStorage") local part = script.Parent +local fired = false + part.Touched:Connect(function(hit) + if fired then return end local h = hit.Parent and hit.Parent:FindFirstChild("Humanoid") if not h then return end - print("ПОБЕДА! Ты нашёл выход!") - h.WalkSpeed = 0 + fired = true + local ev = ReplicatedStorage:FindFirstChild("WinReached") + if ev then ev:Fire() end end)`, },