Files
2026-11-09 22:37:44 +05:00

128 lines
5.7 KiB
Lua

-- Правки лобби №5 (Studio, режим редактирования; один раз — повторный запуск ничего не делает), потом Ctrl+S.
-- 1) Фонтан ×1.75; его высокие фонари и старые фонари вокруг прежнего фонтана → ServerStorage.Backup.LobbyFix5.
-- 2) Порталы отъезжают от центра так, чтобы между чашей и аркой было ≥ 7 studs, и опускаются на мостовую:
-- старая модель портала (проём, частицы), триггер Portal_WorldN, новая арка, маркер GuidePortal — всё вместе.
-- Тёмные подставки-звёзды старых порталов → Backup. Надписи миров — крупно над аркой.
-- 3) Табличка «Как играть» со столбами и маркером GuideBoard → Backup (шаг обучения убран в FishingClient).
local ServerStorage = game:GetService("ServerStorage")
local map = workspace.FishingMap
local FLOOR = 1
local GAP = 7
local backup = ServerStorage:FindFirstChild("Backup") or Instance.new("Folder")
backup.Name = "Backup"
backup.Parent = ServerStorage
if backup:FindFirstChild("LobbyFix5") then
return "уже сделано (ServerStorage.Backup.LobbyFix5 есть)"
end
local store = Instance.new("Folder")
store.Name = "LobbyFix5"
store.Parent = backup
local report = {}
local function flat(v)
return Vector3.new(v.X, 0, v.Z)
end
local function move(o, delta)
if o:IsA("Model") then
o:PivotTo(o:GetPivot() + delta)
elseif o:IsA("BasePart") then
o.CFrame = o.CFrame + delta
end
end
---------------------------------------------------------------- 3. табличка
for _, c in ipairs(map:GetChildren()) do
if c:IsA("BasePart") and (c:GetAttribute("GuideTarget") == "Board" or c.Name == "GuideBoard" or (c:GetAttribute("Fix2Orig") ~= nil and c.Size.Y > 6 and c.Size.X < 1.5)) then
c.Parent = store
end
end
table.insert(report, "табличка и маркер → Backup")
---------------------------------------------------------------- 1. фонтан
local fix3 = map:FindFirstChild("LobbyFix3")
local fountain = fix3 and fix3:FindFirstChild("LobbyFountain")
assert(fountain, "нет LobbyFix3.LobbyFountain")
fountain:ScaleTo(fountain:GetScale() * 1.75)
for i = 1, 4 do
local l = fountain:FindFirstChild("Lantern_" .. i)
if l then
l.Parent = store
end
end
local fcf, fsize = fountain:GetBoundingBox()
local fr = math.max(fsize.X, fsize.Z) / 2
-- старые фонари у прежнего фонтана (Workspace, в радиусе 16) — теперь стояли бы в чаше
for _, c in ipairs(workspace:GetChildren()) do
if c:IsA("BasePart") and flat(c.Position).Magnitude < 16 and c.Position.Y > 4 and c.Position.Y < 13 and c.Size.Magnitude < 10 then
c.Parent = store
end
end
table.insert(report, ("фонтан: ширина %.1f"):format(fr * 2))
---------------------------------------------------------------- 2. порталы
for _, id in ipairs({ "World1", "World2", "World3", "World4" }) do
local old = map:FindFirstChild("PortalModel_" .. id)
local trigger = map:FindFirstChild("Portal_" .. id)
local arch = map:FindFirstChild("PortalArch_" .. id)
if not (old and trigger and arch) then
table.insert(report, id .. ": нет частей портала, пропуск")
continue
end
-- подставки-звёзды → Backup
for _, p in ipairs(old:GetDescendants()) do
if p:IsA("BasePart") and p.Size.X > 11 and p.Size.Z > 11 then
p.Parent = store
end
end
local acf, asize = arch:GetBoundingBox()
local dir = flat(arch:GetPivot().Position).Unit
local cur = flat(arch:GetPivot().Position).Magnitude
local want = fr + GAP + math.max(asize.X, asize.Z) / 2 * 0.6 -- полуглубина арки по радиусу (≈4 studs)
local delta = dir * math.max(0, want - cur) + Vector3.new(0, FLOOR - arch:GetPivot().Position.Y, 0)
for _, o in ipairs({ old, trigger, arch }) do
move(o, delta)
end
if id == "World1" then
local g = map:FindFirstChild("GuidePortal")
if g then
move(g, Vector3.new(delta.X, 0, delta.Z))
end
end
-- надпись мира: крупно над аркой (размер в studs — одинаково читается с любого расстояния)
local top = acf.Position.Y + asize.Y / 2 + delta.Y
for _, root in ipairs({ trigger, old }) do
for _, bb in ipairs(root:GetDescendants()) do
if bb:IsA("BillboardGui") then
local host = bb.Adornee or bb.Parent
local y = host:IsA("BasePart") and host.Position.Y or top
bb.Size = UDim2.fromScale(16, 3.2)
bb.StudsOffset = Vector3.new(0, top + 2.2 - y, 0)
bb.MaxDistance = 220
for _, t in ipairs(bb:GetDescendants()) do
if t:IsA("TextLabel") then
t.TextScaled = true
t.TextStrokeTransparency = 0.1
t.FontFace = Font.new("rbxasset://fonts/families/Merriweather.json", Enum.FontWeight.Heavy)
end
end
end
end
end
table.insert(report, ("%s: радиус %.1f → %.1f"):format(id, cur, flat(arch:GetPivot().Position).Magnitude))
end
-- проверка зазора: между фонтаном и арками
local overlap = OverlapParams.new()
overlap.FilterType = Enum.RaycastFilterType.Include
local arches = {}
for _, id in ipairs({ "World1", "World2", "World3", "World4" }) do
table.insert(arches, map:FindFirstChild("PortalArch_" .. id))
end
overlap.FilterDescendantsInstances = arches
local hits = workspace:GetPartBoundsInBox(fcf, fsize + Vector3.new(GAP * 2 - 1, 0, GAP * 2 - 1), overlap)
table.insert(report, "арок ближе " .. GAP .. " studs к фонтану: " .. #hits .. " деталей")
return table.concat(report, "\n")