Files
Fishing/tools/mcp/checks/rod-shop.lua
T
2026-11-06 12:34:01 +05:00

34 lines
1.5 KiB
Lua

-- (Client) проверка лавки удочек: подсказка открывает магазин, Михалыч стоит за стойкой
local P = game.Players.LocalPlayer
local map = workspace.FishingMap
local shop = map:FindFirstChild("LobbyShop_Rods")
if not shop then
return "нет LobbyShop_Rods"
end
local pp = shop:FindFirstChildWhichIsA("ProximityPrompt", true)
local part = pp.Parent
local toCenter = -Vector3.new(part.Position.X, 0, part.Position.Z).Unit
P.Character:PivotTo(CFrame.new(part.Position + toCenter * 6 + Vector3.new(0, 3, 0)))
task.wait(0.8)
pp:InputHoldBegin()
task.wait(0.1)
pp:InputHoldEnd()
task.wait(1.2)
local opened
for _, f in ipairs(P.PlayerGui.FishingUI:GetDescendants()) do
if f:IsA("TextLabel") and f.Text:find("Магазин Михалыча", 1, true) then
local w = f
while w and not (w:IsA("Frame") and w.ZIndex == 20) do
w = w.Parent
end
opened = w and w.Visible
end
end
local rig = map:FindFirstChild("Продавец Михалыч")
local base = shop:GetPivot()
local l = rig and base:PointToObjectSpace(rig:GetPivot().Position)
local look = rig and base:VectorToObjectSpace(rig:GetPivot().LookVector)
local feet = rig and (rig.HumanoidRootPart.Position.Y - rig.Humanoid.HipHeight - rig.HumanoidRootPart.Size.Y / 2)
return ("магазин открылся: %s; Михалыч в лавке (%.1f, %.1f, %.1f), смотрит (%.2f, %.2f), ноги Y=%.2f, пол лавки Y=%.2f"):format(
tostring(opened), l.X, l.Y, l.Z, look.X, look.Z, feet, base.Position.Y)