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 8eec59af53 - Show all commits

View File

@ -412,25 +412,71 @@ end)`,
// ═══════════════════════════════════════════════════════════════
// ИГРА 6 — «Угадай цвет»
// ═══════════════════════════════════════════════════════════════
'color-tiles': {
g6_main: `-- === ИГРА «УГАДАЙ ЦВЕТ» — главный скрипт (Lua) ===
'color-tiles': (function() {
const overrides = {
g6_main: `-- === ИГРА «ЦВЕТНЫЕ ПЛИТКИ» — главный скрипт (Lua) ===
${SNIPPET_BROADCAST}
local colors = { "red", "green", "blue", "yellow" }
local target = colors[math.random(1, #colors)]
print("Встань на плитку цвета: " .. target)
local Players = game:GetService("Players")
local player = Players.LocalPlayer
local painted = 0
local TOTAL = 36
local won = false
local ev = getEvent("TileStepped")
ev.Event:Connect(function(color)
if color == target then
print("Верно! +1 очко")
target = colors[math.random(1, #colors)]
print("Теперь встань на: " .. target)
else
print("Неверно! Нужен " .. target)
__rbxl_show_text("Наступи на все плитки!", 3)
-- Счётчик в правом верхнем углу
local screenGui = Instance.new("ScreenGui", player.PlayerGui)
local label = Instance.new("TextLabel", screenGui)
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(160, 255, 160)
label.TextScaled = true
label.Font = Enum.Font.SourceSansBold
label.Text = "Плитки: 0 / " .. TOTAL
local pickupSound = Instance.new("Sound", workspace)
pickupSound.SoundId = "pickup"; pickupSound.Volume = 0.7
local winSound = Instance.new("Sound", workspace)
winSound.SoundId = "win"; winSound.Volume = 1
local paintEvent = getEvent("TilePainted")
paintEvent.Event:Connect(function()
if won then return end
painted = painted + 1
label.Text = "Плитки: " .. painted .. " / " .. TOTAL
pickupSound:Play()
if painted >= TOTAL 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)`,
},
};
// Скрипт для каждой из 36 плиток — одинаковый код через генератор
const tileScript = `-- === Скрипт цветной плитки (Lua) ===
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local part = script.Parent
local painted = false
part.Touched:Connect(function(hit)
if painted then return end
local h = hit.Parent and hit.Parent:FindFirstChild("Humanoid")
if not h then return end
painted = true
part.Color = Color3.fromRGB(51, 221, 85) -- ярко-зелёный
local ev = ReplicatedStorage:FindFirstChild("TilePainted")
if ev then ev:Fire() end
end)`;
for (let i = 1; i <= 36; i++) overrides['g6_tile_' + i] = tileScript;
return overrides;
})(),
// ═══════════════════════════════════════════════════════════════
// ИГРА 7 — «Ловишка предметов»