feat: 50 игр на Lua + импорт Roblox для всех + поддержка Lua в плеере #39

Merged
min merged 215 commits from feat/lua-50-games-bundle into main 2026-06-09 21:59:25 +00:00
Showing only changes of commit 0ed2cbf376 - Show all commits

View File

@ -196,36 +196,80 @@ end)`,
// ═══════════════════════════════════════════════════════════════ // ═══════════════════════════════════════════════════════════════
// ИГРА 3 — «Не упади» (платформа сужается) // ИГРА 3 — «Не упади» (платформа сужается)
// ═══════════════════════════════════════════════════════════════ // ═══════════════════════════════════════════════════════════════
'dont-fall': { 'dont-fall': (function() {
const overrides = {
g3_main: `-- === ИГРА «НЕ УПАДИ» — главный скрипт (Lua) === g3_main: `-- === ИГРА «НЕ УПАДИ» — главный скрипт (Lua) ===
${SNIPPET_BROADCAST}
local Players = game:GetService("Players") local Players = game:GetService("Players")
local RunService = game:GetService("RunService") local RunService = game:GetService("RunService")
local player = Players.LocalPlayer
local won = false
print("Удержись на платформе как можно дольше!") __rbxl_show_text("Беги вперёд! Плитки исчезают!", 3)
local startTime = tick() local loseSound = Instance.new("Sound", workspace)
local alive = true loseSound.SoundId = "lose"; loseSound.Volume = 1
local winSound = Instance.new("Sound", workspace)
winSound.SoundId = "win"; winSound.Volume = 1
RunService.Heartbeat:Connect(function() RunService.Heartbeat:Connect(function()
if not alive then return end if won then return end
for _, player in ipairs(Players:GetPlayers()) do
local char = player.Character local char = player.Character
if char then if not char then return end
local hrp = char:FindFirstChild("HumanoidRootPart") local hrp = char:FindFirstChild("HumanoidRootPart")
if hrp and hrp.Position.Y < -5 then if hrp and hrp.Position.Y < -3 then
alive = false
local elapsed = math.floor(tick() - startTime)
print("Ты упал! Продержался: " .. elapsed .. " сек")
task.delay(2, function()
player:LoadCharacter() player:LoadCharacter()
startTime = tick() loseSound:Play()
alive = true __rbxl_show_text("Упал! Снова.", 1.5)
end)
end
end
end end
end)
local finishEvent = getEvent("FinishReached")
finishEvent.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)`, end)`,
}, g3_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
fired = true
local ev = ReplicatedStorage:FindFirstChild("FinishReached")
if ev then ev:Fire() end
end)`,
};
// Скрипт каждой плитки — генератор (одинаковый код)
const tileScript = `-- === Скрипт исчезающей плитки (Lua) ===
local Debris = game:GetService("Debris")
local part = script.Parent
local triggered = false
local clickSound = Instance.new("Sound", part)
clickSound.SoundId = "click"; clickSound.Volume = 0.6
part.Touched:Connect(function(hit)
if triggered then return end
local h = hit.Parent and hit.Parent:FindFirstChild("Humanoid")
if not h then return end
triggered = true
clickSound:Play()
-- через 1.2с плитка пропадает
Debris:AddItem(part, 1.2)
end)`;
for (let i = 1; i <= 14; i++) overrides['g3_tile_' + i] = tileScript;
return overrides;
})(),
// ═══════════════════════════════════════════════════════════════ // ═══════════════════════════════════════════════════════════════
// ИГРА 4 — «Кнопка и дверь» // ИГРА 4 — «Кнопка и дверь»