-- Правки лобби №8: декор и рыбки из Blockbench (assets/props/decor_*.bbmodel, fish_*.bbmodel) вместо деталей. -- Запуск: node tools/lobby-fix8.js , выполнить в Studio (режим редактирования), Ctrl+S. Повторный запуск -- пересобирает новый декор; старый (LobbyAmbience и бочки/ящики/клумбы в промежутках ряда) — в ServerStorage.Backup.LobbyFix8. -- Места — те же, что у декора из lobby-fix6 / lobby-decor. Всё ставится на мостовую по лучу, лицом к центру площади. -- Рыбки фонтана: готовые модели кладутся в ReplicatedStorage.FountainFishModels, их берёт FountainFish.client.lua. local ServerStorage = game:GetService("ServerStorage") local ReplicatedStorage = game:GetService("ReplicatedStorage") local map = workspace.FishingMap local R = 80 local BIG = 1.4 -- крупный декор — в масштабе лавок local ANIMAL = 0.7 -- куры и коты: чуть ниже колена персонажа local FISH = 0.9 -- рыбки ≈ 1.5 studs local TITLE_FONT = Font.new("rbxasset://fonts/families/Merriweather.json", Enum.FontWeight.Heavy) local report = {} local backup = ServerStorage:FindFirstChild("Backup") or Instance.new("Folder") backup.Name = "Backup" backup.Parent = ServerStorage local store = backup:FindFirstChild("LobbyFix8") local first = store == nil if first then store = Instance.new("Folder") store.Name = "LobbyFix8" store.Parent = backup end ---------------------------------------------------------------- старое → Backup if first then local amb = map:FindFirstChild("LobbyAmbience") if amb then amb.Parent = store end -- в промежутках ряда оставляем только фонарь (детали у оси фонаря), остальное — в резерв local decor = map:FindFirstChild("LobbyMarketDecor") for _, g in ipairs(decor and decor:GetChildren() or {}) do local deg = tonumber(g.Name:match("^Gap_(%d+)$")) if deg then local a = math.rad(deg) local axis = Vector3.new(math.cos(a) * R, 0, math.sin(a) * R) local keep = Instance.new("Folder") keep.Name = g.Name keep:SetAttribute("Deg", deg) for _, p in ipairs(g:GetChildren()) do if p:IsA("BasePart") and (Vector3.new(p.Position.X, 0, p.Position.Z) - axis).Magnitude > 1.2 then p.Parent = keep end end keep.Parent = store end end end local new = map:FindFirstChild("LobbyDecor") if new then new:Destroy() end new = Instance.new("Folder") new.Name = "LobbyDecor" new.Parent = map local rayParams = RaycastParams.new() rayParams.FilterType = Enum.RaycastFilterType.Exclude rayParams.FilterDescendantsInstances = { new } local function floorY(x, z) local hit = workspace:Raycast(Vector3.new(x, 40, z), Vector3.new(0, -80, 0), rayParams) return hit and hit.Position.Y or 1 end -- поставить модель: точка (x, z) на полу, фасад (−Z модели) к цели (по умолчанию — к центру площади), доп. поворот yaw local function put(build, name, xz, scale, yaw, target) local x, z = xz[1], xz[2] local m = build(new) m.Name = name m:ScaleTo(scale) local p = Vector3.new(x, floorY(x, z), z) local t = target or Vector3.new(0, p.Y, 0) if (Vector3.new(t.X, p.Y, t.Z) - p).Magnitude < 0.01 then t = p + Vector3.new(0, 0, -1) end m:PivotTo(CFrame.lookAt(p, Vector3.new(t.X, p.Y, t.Z)) * CFrame.Angles(0, math.rad(yaw or 0), 0)) for _, d in ipairs(m:GetDescendants()) do if d:IsA("BasePart") then d.Anchored = true -- мелочь не мешает ходить if d.Size.Magnitude < 1.2 then d.CanCollide = false end end end return m end -- точка в осях «уголка»: центр (cx, cz), поворот yaw (как CFrame.Angles в lobby-fix6) local function local2world(cx, cz, yaw, lx, lz) local cf = CFrame.new(cx, 0, cz) * CFrame.Angles(0, math.rad(yaw or 0), 0) * CFrame.new(lx, 0, lz) return { cf.X, cf.Z } end ---------------------------------------------------------------- уголки (места как в lobby-fix6) -- колодец (северо-запад) put(BUILD.well, "Well", { -55, -62 }, BIG) put(BUILD.flowerpot, "Flowerpot", local2world(-55, -62, 0, 4, 1.5), 1.0) put(BUILD.crates_barrels, "CratesBarrels", local2world(-55, -62, 0, -4.5, 1), BIG) put(BUILD.cat_lie_ginger, "Cat", local2world(-55, -62, 0, 3.2, -2.8), ANIMAL * 1.1, 40) -- сети, лодка, ящики (северо-восток) do local cx, cz, yaw = 55, -62, 30 put(BUILD.nets, "Nets", { cx, cz }, BIG) local boat = local2world(cx, cz, yaw, 0, 6) put(BUILD.boat, "Boat", boat, BIG, 90) put(BUILD.crates_barrels, "CratesBarrels", local2world(cx, cz, yaw, -6.5, 2.5), BIG) put(BUILD.cat_sit_gray, "Cat", local2world(cx, cz, yaw, 6, 2), ANIMAL) end -- телега с бочками (юго-запад от точки появления) do local cx, cz, yaw = -17, 60, 15 put(BUILD.cart, "Cart", { cx, cz }, BIG, 90) put(BUILD.flowerpot, "Flowerpot", local2world(cx, cz, yaw, 4.5, 3), 1.0) put(BUILD.cat_sit_ginger, "Cat", local2world(cx, cz, yaw, -3.6, 3), ANIMAL, -60) end -- стог с вилами и куры (юго-восток от точки появления) do local cx, cz, yaw = 17, 60, -10 put(BUILD.haystack, "Haystack", { cx, cz }, BIG) local hens = { { -3.6, 2.2, 30, BUILD.chicken }, { -2.4, 3.8, -50, BUILD.chicken_peck }, { 3.5, 2.8, 120, BUILD.chicken } } for i, h in ipairs(hens) do put(h[4], "Chicken_" .. i, local2world(cx, cz, yaw, h[1], h[2]), ANIMAL, h[3]) end put(BUILD.crates_barrels, "CratesBarrels", local2world(cx, cz, yaw, -5.2, 1.2), BIG * 0.8) put(BUILD.flowerpot, "Flowerpot", local2world(cx, cz, yaw, 3.8, -2.6), 1.0) end -- указатель у дорожки: лицом к точке появления; стрелки +X модели смотрят на запад, −X — на восток do local sign = put(BUILD.signpost, "Signpost", { -8.5, 40 }, BIG, 0, Vector3.new(-8.5, 0, 60)) local texts = { Arrow1_Face = "🎣 Удочки", Arrow2_Face = "⚪ Скупка", Arrow3_Face = "🐛 Наживка" } for name, text in pairs(texts) do local face = sign:FindFirstChild(name, true) if face then for _, side in ipairs({ Enum.NormalId.Front, Enum.NormalId.Back }) do local sg = Instance.new("SurfaceGui") sg.Face = side sg.SizingMode = Enum.SurfaceGuiSizingMode.PixelsPerStud sg.PixelsPerStud = 50 sg.LightInfluence = 0.3 sg.Parent = face local t = Instance.new("TextLabel") t.Size = UDim2.fromScale(1, 1) t.BackgroundTransparency = 1 t.FontFace = TITLE_FONT t.TextScaled = true t.TextColor3 = Color3.fromRGB(255, 232, 180) t.TextStrokeTransparency = 0.4 t.Text = text t.Parent = sg local pad = Instance.new("UIPadding") pad.PaddingTop, pad.PaddingBottom = UDim.new(0.1, 0), UDim.new(0.1, 0) pad.PaddingLeft, pad.PaddingRight = UDim.new(0.06, 0), UDim.new(0.12, 0) pad.Parent = t end end end put(BUILD.flowerpot, "Flowerpot", { -10.3, 41.2 }, 1.0) end ---------------------------------------------------------------- промежутки торгового ряда: ящики с бочками и клумба for _, f in ipairs(store:GetChildren()) do local deg = f:GetAttribute("Deg") if deg then local a = math.rad(deg) local c, s = math.cos(a), math.sin(a) put(BUILD.crates_barrels, "CratesBarrels_" .. deg, { c * (R + 5), s * (R + 5) }, BIG) put(BUILD.flowerbed, "Flowerbed_" .. deg, { c * (R - 9), s * (R - 9) }, BIG) end end ---------------------------------------------------------------- гирлянды флажков между фонарями вокруг площади do local posts = {} for _, p in ipairs(map:GetChildren()) do if p:IsA("BasePart") and p.Shape == Enum.PartType.Cylinder and math.abs(p.Size.X - 9) < 0.5 and math.abs(p.Position.Y - 5.5) < 0.6 then local r = Vector3.new(p.Position.X, 0, p.Position.Z).Magnitude if r > 33 and r < 56 then table.insert(posts, p.Position) end end end table.sort(posts, function(a, b) return math.atan2(a.Z, a.X) < math.atan2(b.Z, b.X) end) local SPAN = 8.08 * BIG -- длина одной гирлянды модели local n = 0 for i = 1, #posts do local a, b = posts[i], posts[i % #posts + 1] local A, B = Vector3.new(a.X, 10.2, a.Z), Vector3.new(b.X, 10.2, b.Z) local len = (B - A).Magnitude if len > 6 and len < 42 then local k = math.max(1, math.ceil(len / SPAN)) local s = len / k / 8.08 for j = 1, k do local p = A:Lerp(B, (j - 0.5) / k) local m = BUILD.bunting(new) m.Name = "Bunting" m:ScaleTo(s) -- ось X модели — вдоль гирлянды; концы верёвки (на высоте 1.51 модели) — на высоте фонарей m:PivotTo(CFrame.lookAt(p, p + (B - A).Unit:Cross(Vector3.yAxis)) * CFrame.new(0, -1.51 * s, 0)) for _, d in ipairs(m:GetDescendants()) do if d:IsA("BasePart") then d.Anchored, d.CanCollide, d.CanQuery, d.CastShadow = true, false, false, false end end n += 1 end end end table.insert(report, ("гирлянд: %d (фонарей %d)"):format(n, #posts)) end ---------------------------------------------------------------- рыбки для фонтана do local old = ReplicatedStorage:FindFirstChild("FountainFishModels") if old then old:Destroy() end local folder = Instance.new("Folder") folder.Name = "FountainFishModels" for _, k in ipairs({ "fish_gold", "fish_koi", "fish_carp", "fish_roach" }) do local m = BUILD[k](folder) m.Name = k m:ScaleTo(FISH) m:PivotTo(CFrame.new()) for _, d in ipairs(m:GetDescendants()) do if d:IsA("BasePart") then d.Anchored, d.CanCollide, d.CanQuery, d.CanTouch, d.CastShadow = true, false, false, false, false end end -- точка, вокруг которой виляет хвост (корень хвоста в модели: z = 0.47) m:SetAttribute("TailPivotZ", 0.47 * FISH) end folder.Parent = ReplicatedStorage table.insert(report, "рыбок-моделей: " .. #folder:GetChildren()) end -- проверка: декор не задевает лавки, порталы, двор гильдии, доски local overlap = OverlapParams.new() overlap.FilterType = Enum.RaycastFilterType.Exclude overlap.FilterDescendantsInstances = { new } for _, m in ipairs(new:GetChildren()) do if m.Name ~= "Bunting" then local cf, size = m:GetBoundingBox() local hits = {} for _, p in ipairs(workspace:GetPartBoundsInBox(cf * CFrame.new(0, 0.5, 0), size - Vector3.new(0.4, 1, 0.4), overlap)) do if p.CanCollide and p.Size.X < 60 and p.Size.Z < 60 and p.Position.Y > 1.3 then hits[(p.Parent and p.Parent ~= map) and p.Parent.Name or p.Name] = true end end for k in pairs(hits) do table.insert(report, m.Name .. " задевает " .. k) end end end table.insert(report, "декора: " .. #new:GetChildren()) return table.concat(report, "\n")