feat(lua-games): полный паритет для игры 5 «Лабиринт»

JS-версия:
- ui.showText('Найди выход из лабиринта!', 3)
- onMessage 'win' → showText + win sound + confetti
- g5_finish: onTouch → broadcast 'win'

Lua-версия:
- __rbxl_show_text подсказка + 'Победа!'
- BindableEvent WinReached
- g5_finish: Touched на финиш-зоне → ev:Fire (с fired-флагом)
- На победе: confetti над игроком
This commit is contained in:
min 2026-06-09 17:21:56 +03:00
parent 36321f0d17
commit f7074f5cd7

View File

@ -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)`,
},