-- Новые лавки и доски лидеров в лобби из моделей Blockbench (assets/props/lobby_*.bbmodel). -- Запуск: node tools/build-lobby-shops.js собирает один Luau-файл (модули моделей от bbmodel-to-luau.js + -- этот файл, функции моделей доступны как BUILD.<имя>) и выполняет его в Studio, режим редактирования. -- Повторный запуск пересобирает: новые модели удаляются и строятся заново, старые уже лежат в Backup. -- -- * «Скупка рыбы» Зины (восток) → lobby_fish_buyer; «Премиум» Барона Злотова (северо-восток) → lobby_premium. -- Старая лавка (все детали в её габаритах, как в WorldBuilder.stallParts) → ServerStorage.Backup.<ключ>. -- Вывеска — текст и цвет старой вывески, шрифт Merriweather; подсказка (Sell / RobuxPasses) — на стойке; -- место NPC — за стойкой, лицом к покупателям. -- * Доски «Топ рыболовов» и «Топ донатеров» → lobby_leaderboard; список (SurfaceGui Rows) и заголовок -- переезжают на новые поверхности, атрибут Leaderboard сохраняется (строки обновляет Leaderboards.server.lua). -- * Наживка: ящик у лавки Михалыча → Backup, на его место лавка lobby_bait с подсказкой Action = Bait. -- После запуска сохраните плейс (Ctrl+S). local ServerStorage = game:GetService("ServerStorage") local map = workspace.FishingMap local backup = ServerStorage:FindFirstChild("Backup") or Instance.new("Folder") backup.Name = "Backup" backup.Parent = ServerStorage local SHOP_SCALE, BOARD_SCALE = 1.4, 1.35 local TITLE_FONT = Font.new("rbxasset://fonts/families/Merriweather.json", Enum.FontWeight.Heavy) local report = {} local function floorAt(pos, ignore) local params = RaycastParams.new() params.FilterType = Enum.RaycastFilterType.Exclude params.FilterDescendantsInstances = ignore local hit = workspace:Raycast(pos + Vector3.new(0, 30, 0), Vector3.new(0, -60, 0), params) return hit and hit.Position.Y or 1 end local function find(model, name) local p = model:FindFirstChild(name, true) return p and p:IsA("BasePart") and p or nil end -- модель на место: низ на полу, фасад (−Z модели) — по направлению front local function place(buildFn, name, pos, front, scale, ignore) local old = map:FindFirstChild(name) if old then old:Destroy() end local model = buildFn(map) model.Name = name model:ScaleTo(scale) local y = floorAt(pos, { model, backup, table.unpack(ignore or {}) }) local at = Vector3.new(pos.X, y, pos.Z) model:PivotTo(CFrame.lookAt(at, at + Vector3.new(front.X, 0, front.Z))) for _, p in ipairs(model:GetDescendants()) do if p:IsA("BasePart") then p.Anchored = true -- на всякий случай: ничего не должно рассыпаться end end -- тёплый свет в фонарях for _, side in ipairs({ "LanternL_Glow", "LanternR_Glow" }) do for _, g in ipairs(model:GetDescendants()) do if g.Name == side and g:IsA("BasePart") and not g:FindFirstChildOfClass("PointLight") then local l = Instance.new("PointLight") l.Color = Color3.fromRGB(255, 186, 110) l.Range = 16 l.Brightness = 1.4 l.Shadows = true l.Parent = g g.Color = Color3.fromRGB(255, 196, 120) end end end return model end local function signText(part, text, color) local old = part:FindFirstChild("ShopSign") if old then old:Destroy() end local sg = Instance.new("SurfaceGui") sg.Name = "ShopSign" sg.Face = Enum.NormalId.Front sg.SizingMode = Enum.SurfaceGuiSizingMode.PixelsPerStud sg.PixelsPerStud = 40 sg.LightInfluence = 0 sg.Parent = part local t = Instance.new("TextLabel") t.Size = UDim2.fromScale(1, 1) t.BackgroundTransparency = 1 t.FontFace = TITLE_FONT t.TextScaled = true t.TextColor3 = color or Color3.fromRGB(255, 214, 120) t.TextStrokeTransparency = 0.3 t.TextStrokeColor3 = Color3.fromRGB(40, 28, 20) t.Text = text t.Parent = sg local pad = Instance.new("UIPadding") pad.PaddingLeft, pad.PaddingRight = UDim.new(0.04, 0), UDim.new(0.04, 0) pad.PaddingTop, pad.PaddingBottom = UDim.new(0.12, 0), UDim.new(0.12, 0) pad.Parent = t end ---------------------------------------------------------------- лавки с NPC -- старая лавка WorldBuilder.stall(cf): всё, что стоит в её габаритах прямо в FishingMap (кроме места NPC) local function inStall(cf, p) local l = cf:PointToObjectSpace(p) return math.abs(l.X) <= 15.5 and l.Y >= -0.5 and l.Y <= 21 and l.Z >= -14.5 and l.Z <= 9.5 end local function replaceStall(key, npcName, buildFn, signFallback) -- место NPC этой лавки local spot for _, c in ipairs(map:GetChildren()) do if c:IsA("BasePart") and c:GetAttribute("NpcName") == npcName then spot = c end end assert(spot, "Нет места NPC " .. npcName) local folder = backup:FindFirstChild(key) if not folder then -- первый запуск: кадр старой лавки по месту NPC (в лавке NPC стоит в (0, 4, 1.5) от неё, к покупателям −Z) local away = Vector3.new(spot.Position.X, 0, spot.Position.Z).Unit local base = Vector3.new(spot.Position.X, 1, spot.Position.Z) - away * 1.5 local cf = CFrame.lookAt(base, base - away) folder = Instance.new("Folder") folder.Name = key folder:SetAttribute("StallCF", cf) folder:SetAttribute("SpotCF", spot.CFrame) for _, c in ipairs(map:GetChildren()) do if c ~= spot and (c:IsA("BasePart") or c:IsA("Model")) and not c:GetAttribute("NpcName") and not c:GetAttribute("Leaderboard") then local p = c:IsA("Model") and c:GetPivot().Position or c.Position if inStall(cf, p) and not c.Name:find("^Portal") and not c.Name:find("^LobbyShop_") then c.Parent = folder end end end folder.Parent = backup end local cf = folder:GetAttribute("StallCF") -- что было у старой лавки: подсказка и вывеска local oldPrompt, signTextValue, signColor for _, d in ipairs(folder:GetDescendants()) do if d:IsA("ProximityPrompt") and d:GetAttribute("Action") then oldPrompt = d elseif d:IsA("SurfaceGui") and d.Parent:IsA("BasePart") and d.Parent.Position.Y > cf.Position.Y + 12 then local t = d:FindFirstChildWhichIsA("TextLabel", true) if t and t.Text ~= "" then signTextValue, signColor = t.Text, t.TextColor3 end end end local model = place(buildFn, "LobbyShop_" .. key, cf.Position, cf.LookVector, SHOP_SCALE, { folder }) local base = model:GetPivot() -- подсказка на стойке local top = find(model, "Counter_Top") if top and oldPrompt then local pp = oldPrompt:Clone() pp.RequiresLineOfSight = false pp.MaxActivationDistance = math.max(pp.MaxActivationDistance, 14) pp.Parent = top end -- вывеска local face = find(model, "Sign_Face") if face then signText(face, signTextValue or signFallback, signColor) end -- NPC за стойкой: X = 0, Z ≈ 0.5 (в масштабе), ноги на полу лавки local floorY = base.Position.Y + 0.4 * SHOP_SCALE spot.CFrame = CFrame.new((base * CFrame.new(0, 0, 0.5 * SHOP_SCALE)).Position.X, floorY + 3, (base * CFrame.new(0, 0, 0.5 * SHOP_SCALE)).Position.Z) * (base - base.Position) table.insert(report, ("%s: %s, вывеска «%s», подсказка %s"):format(key, model.Name, tostring(signTextValue or signFallback), oldPrompt and tostring(oldPrompt:GetAttribute("Action")) or "нет")) return model end replaceStall("FishBuyer", "Скупщица Зина", BUILD.fish_buyer, "⚪ СКУПКА РЫБЫ") replaceStall("Premium", "Барон Злотов", BUILD.premium, "💎 ПРЕМИУМ") ---------------------------------------------------------------- доски лидеров for _, id in ipairs({ "Catch", "Donate", "Earn" }) do local key = "Leaderboard_" .. id local folder = backup:FindFirstChild(key) if not folder then -- старая доска: модель с атрибутом Leaderboard = id (имя бывает любым, например «daa») local old for _, c in ipairs(map:GetChildren()) do if c:IsA("Model") and c:GetAttribute("Leaderboard") == id and not c:FindFirstChild("Board_Face", true) then old = c end end assert(old, "Нет доски " .. key) folder = Instance.new("Folder") folder.Name = key folder:SetAttribute("BoardCF", old:GetPivot()) folder:SetAttribute("BoardId", old:GetAttribute("Leaderboard")) old.Parent = folder folder.Parent = backup end local cf = folder:GetAttribute("BoardCF") local old = folder:FindFirstChildOfClass("Model") local model = place(BUILD.leaderboard, key, cf.Position, cf.LookVector, BOARD_SCALE, { folder }) model:SetAttribute("Leaderboard", folder:GetAttribute("BoardId")) -- список и заголовок старой доски — копии на новые поверхности (оригиналы остаются в резервной доске) local rows = old and old:FindFirstChild("Rows", true) local boardFace = find(model, "Board_Face") if rows and boardFace then local g = rows:Clone() g.Face = Enum.NormalId.Front g.Parent = boardFace end local plaque = old and old:FindFirstChild("Plaque", true) local titleGui = plaque and plaque:FindFirstChildOfClass("SurfaceGui") local titleFace = find(model, "Title_Face") if titleGui and titleFace then local g = titleGui:Clone() g.Face = Enum.NormalId.Front for _, t in ipairs(g:GetDescendants()) do if t:IsA("TextLabel") then t.FontFace = TITLE_FONT end end g.Parent = titleFace end table.insert(report, ("%s: строки %s, заголовок %s"):format(key, tostring(rows ~= nil), tostring(titleGui ~= nil))) end ---------------------------------------------------------------- лавка наживки do local shops = map:FindFirstChild("BaitShops") local CRATE = Vector3.new(-49.5, 0, 15) -- ящик наживки у лавки Михалыча local folder = backup:FindFirstChild("BaitCrate_Lobby") if not folder then folder = Instance.new("Folder") folder.Name = "BaitCrate_Lobby" for _, c in ipairs(shops and shops:GetChildren() or {}) do if c:IsA("BasePart") and Vector3.new(c.Position.X - CRATE.X, 0, c.Position.Z - CRATE.Z).Magnitude < 6 then c.Parent = folder end end folder.Parent = backup end -- рядом с лавкой Михалыча, между ней и лавкой Купчихи Златы (не задевая обеих), фасадом к центру площади; -- лавка поменьше остальных: места между ними немного local pos = Vector3.new(-58, 1, 24) local model = place(BUILD.bait, "LobbyShop_Bait", pos, -pos.Unit * Vector3.new(1, 0, 1), 1.15, { folder }) local top = find(model, "Counter_Top") if top then local pp = Instance.new("ProximityPrompt") pp.ActionText = "Наживка" pp.ObjectText = "Лавка наживки" pp.HoldDuration = 0 pp.MaxActivationDistance = 14 pp.RequiresLineOfSight = false pp:SetAttribute("Action", "Bait") pp.Parent = top end local face = find(model, "Sign_Face") if face then signText(face, "🐛 НАЖИВКА") end table.insert(report, ("Наживка: %s, ящик в резерв: %d деталей"):format(model.Name, #folder:GetChildren())) end return table.concat(report, "\n")