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 cc5717f5a3 - Show all commits

View File

@ -1191,37 +1191,88 @@ end)`,
// ═══════════════════════════════════════════════════════════════ // ═══════════════════════════════════════════════════════════════
// ИГРА 14 — «Собери по тегу» // ИГРА 14 — «Собери по тегу»
// ═══════════════════════════════════════════════════════════════ // ═══════════════════════════════════════════════════════════════
'collect-by-tag': { 'collect-by-tag': (function() {
g14_main: `-- === ИГРА «СОБЕРИ ПО ТЕГУ» (Lua) === const TOTAL = 7;
local CollectionService = game:GetService("CollectionService") const overrides = {
g14_main: `-- === ИГРА «СОБЕРИ ПО ТЕГАМ» — главный скрипт (Lua) ===
${SNIPPET_BROADCAST} ${SNIPPET_BROADCAST}
local total = #CollectionService:GetTagged("звезда") local CollectionService = game:GetService("CollectionService")
local collected = 0 local Players = game:GetService("Players")
print("Собери все " .. total .. " звёзд!") local player = Players.LocalPlayer
local TOTAL = ${TOTAL}
local won = false
local ev = getEvent("StarCollected") __rbxl_show_text("Собери все ЖЁЛТЫЕ звёзды!", 3)
ev.Event:Connect(function()
collected = collected + 1 -- Счётчик в правом верхнем углу
print("Собрано: " .. collected .. "/" .. total) local screenGui = Instance.new("ScreenGui", player.PlayerGui)
if collected >= total then local label = Instance.new("TextLabel", screenGui)
print("ПОБЕДА! Все звёзды собраны!") 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(255, 215, 0)
label.TextScaled = true
label.Font = Enum.Font.SourceSansBold
label.Text = "Звёзды: 0 / " .. TOTAL
local coinSound = Instance.new("Sound", workspace)
coinSound.SoundId = "coin"; coinSound.Volume = 0.8
local winSound = Instance.new("Sound", workspace)
winSound.SoundId = "win"; winSound.Volume = 1
-- Помечаем все звёзды тегом 'звезда' (с небольшой задержкой
-- скрипты звёзд должны успеть запуститься и зарегистрировать part).
task.delay(0.2, function()
for i = 1, TOTAL do
local star = workspace:FindFirstChild("Звезда_" .. i)
if star then CollectionService:AddTag(star, "звезда") end
end
end)
-- Звёзды сообщают о сборе. Главный скрипт считает оставшиеся через
-- CollectionService:GetTagged паритет с JS game.scene.getTagged.
local collectEvent = getEvent("StarCollected")
collectEvent.Event:Connect(function()
if won then return end
local left = #CollectionService:GetTagged("звезда")
label.Text = "Звёзды: " .. (TOTAL - left) .. " / " .. TOTAL
coinSound:Play()
if left == 0 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
end)`, end)`,
g14_star: `-- === Скрипт звезды (Lua) === };
// Скрипт каждой звезды — одинаковый: на touch → untag + destroy + Fire
const starScript = `-- === Скрипт звезды (Lua) ===
local CollectionService = game:GetService("CollectionService") local CollectionService = game:GetService("CollectionService")
local ReplicatedStorage = game:GetService("ReplicatedStorage") local ReplicatedStorage = game:GetService("ReplicatedStorage")
local part = script.Parent local part = script.Parent
CollectionService:AddTag(part, "звезда") local picked = false
part.Touched:Connect(function(hit) part.Touched:Connect(function(hit)
if picked then return end
local h = hit.Parent and hit.Parent:FindFirstChild("Humanoid") local h = hit.Parent and hit.Parent:FindFirstChild("Humanoid")
if not h then return end if not h then return end
picked = true
-- Снимаем тег и удаляем звезду, потом шлём событие.
CollectionService:RemoveTag(part, "звезда")
part:Destroy()
local ev = ReplicatedStorage:FindFirstChild("StarCollected") local ev = ReplicatedStorage:FindFirstChild("StarCollected")
if ev then ev:Fire() end if ev then ev:Fire() end
part:Destroy() end)`;
end)`, for (let i = 1; i <= TOTAL; i++) {
}, overrides['g14_star_' + i] = starScript;
}
return overrides;
})(),
// ═══════════════════════════════════════════════════════════════ // ═══════════════════════════════════════════════════════════════
// ИГРА 15 — «Тир» // ИГРА 15 — «Тир»