-- KM studios | Złap blok Menu (1 skrypt - sterowanie fizyczne + pełne menu KM studios) -- By Kami_ytt local Players = game:GetService("Players") local RunService = game:GetService("RunService") local UserInputService = game:GetService("UserInputService") local Stats = game:GetService("Stats") local CoreGui = game:GetService("CoreGui") local LocalPlayer = Players.LocalPlayer local ParentGui = (gethui and gethui()) or CoreGui if ParentGui:FindFirstChild("KMStudios_MoveBlocksMenu") then ParentGui.KMStudios_MoveBlocksMenu:Destroy() end if ParentGui:FindFirstChild("KMStudios_StatsOverlay") then ParentGui.KMStudios_StatsOverlay:Destroy() end local scriptDestroyed = false local globalConnections = {} local function TrackConnection(conn) if not conn then return nil end if scriptDestroyed then if conn.Connected then conn:Disconnect() end return conn end table.insert(globalConnections, conn) return conn end local ScreenGui = Instance.new("ScreenGui") ScreenGui.Name = "KMStudios_MoveBlocksMenu" ScreenGui.ResetOnSpawn = false ScreenGui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling ScreenGui.Parent = ParentGui -- ========================================== -- ZEWNĘTRZNY LICZNIK FPS + PING (PRAWY DÓŁ, ZIELONY) -- ========================================== local StatsGui = Instance.new("ScreenGui") StatsGui.Name = "KMStudios_StatsOverlay" StatsGui.ResetOnSpawn = false StatsGui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling StatsGui.Parent = ParentGui local PerfLabel = Instance.new("TextLabel") PerfLabel.Name = "PerfLabel" PerfLabel.AnchorPoint = Vector2.new(1, 1) PerfLabel.Size = UDim2.new(0, 170, 0, 24) PerfLabel.Position = UDim2.new(1, -12, 1, -12) PerfLabel.BackgroundTransparency = 1 PerfLabel.Text = "FPS: -- | Ping: --ms" PerfLabel.TextColor3 = Color3.fromRGB(45, 255, 95) PerfLabel.TextStrokeTransparency = 0.25 PerfLabel.Font = Enum.Font.GothamBold PerfLabel.TextSize = 13 PerfLabel.TextXAlignment = Enum.TextXAlignment.Right PerfLabel.TextYAlignment = Enum.TextYAlignment.Bottom PerfLabel.Parent = StatsGui local function ReadSafePingMs() local pingMs = nil pcall(function() local network = Stats and Stats:FindFirstChild("Network") local serverStats = network and network:FindFirstChild("ServerStatsItem") local pingItem = serverStats and serverStats:FindFirstChild("Data Ping") if pingItem and type(pingItem.GetValue) == "function" then local rawVal = pingItem:GetValue() if type(rawVal) == "number" and rawVal == rawVal and rawVal >= 0 and rawVal < math.huge then pingMs = math.round(rawVal) end end end) return pingMs end local fpsFrames = 0 local fpsTimer = 0 local currentFps = 0 TrackConnection(RunService.RenderStepped:Connect(function(dt) if scriptDestroyed then return end if type(dt) ~= "number" or dt <= 0 or dt ~= dt or dt >= math.huge then dt = 1 / 60 end fpsFrames += 1 fpsTimer += dt if fpsTimer >= 0.5 then currentFps = math.max(0, math.round(fpsFrames / fpsTimer)) local pingMs = ReadSafePingMs() if pingMs ~= nil then PerfLabel.Text = string.format("FPS: %d | Ping: %dms", currentFps, pingMs) else PerfLabel.Text = string.format("FPS: %d | Ping: --ms", currentFps) end fpsFrames = 0 fpsTimer = 0 end end)) -- ========================================== -- STANY I USTAWIENIA GUI -- ========================================== local States = { GrabBlock = false } local HoldDistance = 14 local MIN_HOLD_DISTANCE = 1 local MAX_HOLD_DISTANCE = 400 local STEP_HOLD_DISTANCE = 2 local HeightOffset = 0 local MIN_HEIGHT_OFFSET = -250 local MAX_HEIGHT_OFFSET = 250 local STEP_HEIGHT_OFFSET = 2 local ExtraYawDeg = 0 local ExtraPitchDeg = 0 local ROTATE_STEP_DEG = 15 local CurrentLang = "PL" local SecondPageOpen = false local OptionLabels = {} local OptionButtons = {} local DistanceLabel local DistanceInput local HeightLabel local RotateLabel local isHoldingObject = false local Translations = { PL = { subtitle = "| złap blok", opt1 = "1. Złap blok", distPrefix = "Odległość:", heightPrefix = "Wysokość: ", heightSuffix = "m", rotPrefix = "Obrót: ", infoTitle = "| info & język", langHeader = "Wybierz język / Language:", noteText = [[Witaj w oficjalnym panelu KM studios! JAK DZIAŁAJĄ OPCJE: • 1. Złap blok – włącza celownik na środku ekranu; pozwala chwycić i przenosić fizycznie odłączone obiekty: luźne bloki, fragmenty budynków oraz całe niezaczepione obiekty. • Odległość – wpisz liczbę (np. 25) lub użyj - / +. Odległość nie zmienia się sama ani podczas ruchu. • Wysokość (↓ / ↑) – przesuwa trzymany obiekt w pionie (góra / dół). • Obrót (↶ / ↷) – obraca trzymany obiekt podczas przenoszenia. UWAGA: • W cudzej grze widoczność ruchu u innych graczy zależy od własności sieciowej fizyki (NetworkOwner) i zabezpieczeń gry. WSKAZÓWKI: - Użyj przycisku '>' na górnym pasku, aby przełączać widoki. - Czerwony przycisk 'X' minimalizuje menu do ruchomego kwadratu KM na ekranie. Twórca: Kami_ytt | KM studios]] }, EN = { subtitle = "| grab block", opt1 = "1. Grab Block", distPrefix = "Distance:", heightPrefix = "Height: ", heightSuffix = "m", rotPrefix = "Rotate: ", infoTitle = "| info & language", langHeader = "Select Language / Język:", noteText = [[Welcome to the official KM studios panel! HOW OPTIONS WORK: • 1. Grab Block – shows a center crosshair; lets you grab and move physically detached objects: loose blocks, building sections, and unanchored assemblies. • Distance – type a number (e.g. 25) or use - / +. Distance never changes on its own or while moving. • Height (↓ / ↑) – moves the held object vertically (up / down). • Rotate (↶ / ↷) – rotates the held object while carrying it. NOTE: • In a game you do not own, visibility to other players depends on physics network ownership and game anti-cheat/security. TIPS: - Use the '>' button on the top bar to switch between menus. - The red 'X' button minimizes the UI into a draggable KM square on your screen. Creator: Kami_ytt | KM studios]] } } local function FormatSigned(num) if num > 0 then return "+" .. tostring(math.round(num)) end return tostring(math.round(num)) end local function SetHoldDistanceValue(newVal) local num = tonumber(newVal) if not num or num ~= num then return false end HoldDistance = math.clamp(math.round(num), MIN_HOLD_DISTANCE, MAX_HOLD_DISTANCE) if DistanceLabel then DistanceLabel.Text = Translations[CurrentLang].distPrefix end if DistanceInput then DistanceInput.Text = tostring(HoldDistance) .. "m" end return true end local function UpdateDistanceText() SetHoldDistanceValue(HoldDistance) end local function UpdateHeightText() if HeightLabel then local t = Translations[CurrentLang] HeightLabel.Text = t.heightPrefix .. FormatSigned(HeightOffset) .. t.heightSuffix end end local function UpdateRotateText() if RotateLabel then local t = Translations[CurrentLang] RotateLabel.Text = t.rotPrefix .. FormatSigned(ExtraYawDeg) .. "°" end end local function IsPointerOverGuiObject(pos, guiObj) if not guiObj or not guiObj.Parent then return false end if guiObj:IsA("GuiObject") then if not guiObj.Visible then return false end local absPos = guiObj.AbsolutePosition local absSize = guiObj.AbsoluteSize return pos.X >= absPos.X and pos.X <= (absPos.X + absSize.X) and pos.Y >= absPos.Y and pos.Y <= (absPos.Y + absSize.Y) end return false end local function MakeDraggable(dragHandle, targetFrame, onClickCallback, ignoredObjects) local dragging = false local dragMode = nil local activeTouch = nil local dragStart = Vector3.zero local startPos = targetFrame.Position local moved = false local moveConn = nil local endConn = nil local function DisconnectDragListeners() if moveConn then if moveConn.Connected then moveConn:Disconnect() end moveConn = nil end if endConn then if endConn.Connected then endConn:Disconnect() end endConn = nil end end local function StopDragging(fireClick) local wasClick = fireClick and (not moved) dragging = false dragMode = nil activeTouch = nil DisconnectDragListeners() if wasClick and onClickCallback and not scriptDestroyed then onClickCallback() end end local function IsIgnoredPosition(pos) if not ignoredObjects then return false end for _, obj in ipairs(ignoredObjects) do if IsPointerOverGuiObject(pos, obj) then return true end end return false end local function ApplyDelta(pos) local delta = pos - dragStart if delta.Magnitude > 5 then moved = true end targetFrame.Position = UDim2.new( startPos.X.Scale, startPos.X.Offset + delta.X, startPos.Y.Scale, startPos.Y.Offset + delta.Y ) end local beganConn = dragHandle.InputBegan:Connect(function(input) if scriptDestroyed or dragging then return end if IsIgnoredPosition(input.Position) then return end if input.UserInputType == Enum.UserInputType.MouseButton1 then dragging = true dragMode = "mouse" activeTouch = nil moved = false dragStart = input.Position startPos = targetFrame.Position DisconnectDragListeners() moveConn = UserInputService.InputChanged:Connect(function(changedInput) if not dragging or dragMode ~= "mouse" or scriptDestroyed then return end if changedInput.UserInputType == Enum.UserInputType.MouseMovement then if not UserInputService:IsMouseButtonPressed(Enum.UserInputType.MouseButton1) then StopDragging(false) return end ApplyDelta(changedInput.Position) end end) endConn = UserInputService.InputEnded:Connect(function(endedInput) if dragging and dragMode == "mouse" and endedInput.UserInputType == Enum.UserInputType.MouseButton1 then StopDragging(true) end end) elseif input.UserInputType == Enum.UserInputType.Touch then dragging = true dragMode = "touch" activeTouch = input moved = false dragStart = input.Position startPos = targetFrame.Position DisconnectDragListeners() moveConn = UserInputService.InputChanged:Connect(function(changedInput) if not dragging or dragMode ~= "touch" or changedInput ~= activeTouch or scriptDestroyed then return end if changedInput.UserInputType == Enum.UserInputType.Touch then ApplyDelta(changedInput.Position) end end) endConn = UserInputService.InputEnded:Connect(function(endedInput) if dragging and dragMode == "touch" and endedInput == activeTouch then StopDragging(true) end end) end end) TrackConnection(beganConn) TrackConnection(dragHandle.Destroying:Connect(function() StopDragging(false) end)) end -- ========================================== -- GŁÓWNY KONTENER OKNA (ROZMIAR JAK INFO BOARD: 265x215) -- ========================================== local INFO_BOARD_SIZE = UDim2.new(0, 265, 0, 215) local MainFrame = Instance.new("Frame") MainFrame.Name = "MainFrame" MainFrame.Size = INFO_BOARD_SIZE MainFrame.Position = UDim2.new(0.5, -132, 0.5, -107) MainFrame.BackgroundColor3 = Color3.fromRGB(48, 48, 52) MainFrame.BorderSizePixel = 1 MainFrame.BorderColor3 = Color3.fromRGB(95, 95, 100) MainFrame.Parent = ScreenGui local TopBar = Instance.new("Frame") TopBar.Name = "TopBar" TopBar.Size = UDim2.new(1, 0, 0, 28) TopBar.BackgroundColor3 = Color3.fromRGB(70, 70, 75) TopBar.BorderSizePixel = 0 TopBar.Parent = MainFrame local BrandLabel = Instance.new("TextLabel") BrandLabel.Size = UDim2.new(0, 72, 1, 0) BrandLabel.Position = UDim2.new(0, 8, 0, 0) BrandLabel.BackgroundTransparency = 1 BrandLabel.Text = "KM studios" BrandLabel.TextColor3 = Color3.fromRGB(255, 255, 255) BrandLabel.Font = Enum.Font.GothamBold BrandLabel.TextSize = 12 BrandLabel.TextXAlignment = Enum.TextXAlignment.Left BrandLabel.Parent = TopBar local VerifiedBadge = Instance.new("Frame") VerifiedBadge.Size = UDim2.new(0, 14, 0, 14) VerifiedBadge.Position = UDim2.new(0, 80, 0.5, -7) VerifiedBadge.BackgroundColor3 = Color3.fromRGB(0, 145, 255) VerifiedBadge.BorderSizePixel = 0 VerifiedBadge.Parent = TopBar local BadgeCorner = Instance.new("UICorner") BadgeCorner.CornerRadius = UDim.new(1, 0) BadgeCorner.Parent = VerifiedBadge local CheckMark = Instance.new("TextLabel") CheckMark.Size = UDim2.new(1, 0, 1, 0) CheckMark.BackgroundTransparency = 1 CheckMark.Text = "✓" CheckMark.TextColor3 = Color3.fromRGB(255, 255, 255) CheckMark.Font = Enum.Font.GothamBold CheckMark.TextSize = 10 CheckMark.Parent = VerifiedBadge local SubtitleLabel = Instance.new("TextLabel") SubtitleLabel.Size = UDim2.new(0, 96, 1, 0) SubtitleLabel.Position = UDim2.new(0, 98, 0, 0) SubtitleLabel.BackgroundTransparency = 1 SubtitleLabel.Text = Translations[CurrentLang].subtitle SubtitleLabel.TextColor3 = Color3.fromRGB(210, 210, 215) SubtitleLabel.Font = Enum.Font.GothamMedium SubtitleLabel.TextSize = 11 SubtitleLabel.TextXAlignment = Enum.TextXAlignment.Left SubtitleLabel.Parent = TopBar local PageArrowBtn = Instance.new("TextButton") PageArrowBtn.Name = "PageArrowBtn" PageArrowBtn.Size = UDim2.new(0, 28, 0, 28) PageArrowBtn.Position = UDim2.new(1, -56, 0, 0) PageArrowBtn.BackgroundColor3 = Color3.fromRGB(52, 52, 58) PageArrowBtn.BorderSizePixel = 0 PageArrowBtn.Text = ">" PageArrowBtn.TextColor3 = Color3.fromRGB(255, 255, 255) PageArrowBtn.Font = Enum.Font.GothamBold PageArrowBtn.TextSize = 14 PageArrowBtn.ZIndex = 3 PageArrowBtn.Parent = TopBar local CloseBtn = Instance.new("TextButton") CloseBtn.Name = "CloseBtn" CloseBtn.Size = UDim2.new(0, 28, 0, 28) CloseBtn.Position = UDim2.new(1, -28, 0, 0) CloseBtn.BackgroundColor3 = Color3.fromRGB(205, 45, 45) CloseBtn.BorderSizePixel = 0 CloseBtn.Text = "X" CloseBtn.TextColor3 = Color3.fromRGB(255, 255, 255) CloseBtn.Font = Enum.Font.GothamBold CloseBtn.TextSize = 13 CloseBtn.ZIndex = 3 CloseBtn.Parent = TopBar -- ========================================== -- ZMINIMALIZOWANE KWADRATOWE "KÓŁKO" KM -- ========================================== local MiniKM = Instance.new("TextButton") MiniKM.Name = "MiniKM" MiniKM.Size = UDim2.new(0, 42, 0, 42) MiniKM.Position = UDim2.new(0, 20, 0.5, -21) MiniKM.BackgroundColor3 = Color3.fromRGB(45, 45, 50) MiniKM.BorderSizePixel = 2 MiniKM.BorderColor3 = Color3.fromRGB(255, 255, 255) MiniKM.Text = "KM" MiniKM.TextColor3 = Color3.fromRGB(255, 255, 255) MiniKM.Font = Enum.Font.GothamBold MiniKM.TextSize = 14 MiniKM.Visible = false MiniKM.AutoButtonColor = false MiniKM.Parent = ScreenGui MakeDraggable(TopBar, MainFrame, nil, { PageArrowBtn, CloseBtn }) MakeDraggable(MiniKM, MiniKM, function() MiniKM.Visible = false MainFrame.Visible = true end) TrackConnection(CloseBtn.MouseButton1Click:Connect(function() if scriptDestroyed then return end MainFrame.Visible = false MiniKM.Visible = true end)) -- ========================================== -- CELOWNIK NA ŚRODKU EKRANU -- ========================================== local CrosshairFrame = Instance.new("Frame") CrosshairFrame.Name = "CenterCrosshair" CrosshairFrame.AnchorPoint = Vector2.new(0.5, 0.5) CrosshairFrame.Position = UDim2.new(0.5, 0, 0.5, 0) CrosshairFrame.Size = UDim2.new(0, 26, 0, 26) CrosshairFrame.BackgroundTransparency = 1 CrosshairFrame.Visible = false CrosshairFrame.Parent = ScreenGui local CrossH = Instance.new("Frame") CrossH.AnchorPoint = Vector2.new(0.5, 0.5) CrossH.Position = UDim2.new(0.5, 0, 0.5, 0) CrossH.Size = UDim2.new(0, 20, 0, 2) CrossH.BackgroundColor3 = Color3.fromRGB(0, 145, 255) CrossH.BorderSizePixel = 0 CrossH.Parent = CrosshairFrame local CrossV = Instance.new("Frame") CrossV.AnchorPoint = Vector2.new(0.5, 0.5) CrossV.Position = UDim2.new(0.5, 0, 0.5, 0) CrossV.Size = UDim2.new(0, 2, 0, 20) CrossV.BackgroundColor3 = Color3.fromRGB(0, 145, 255) CrossV.BorderSizePixel = 0 CrossV.Parent = CrosshairFrame local CrossDot = Instance.new("Frame") CrossDot.AnchorPoint = Vector2.new(0.5, 0.5) CrossDot.Position = UDim2.new(0.5, 0, 0.5, 0) CrossDot.Size = UDim2.new(0, 4, 0, 4) CrossDot.BackgroundColor3 = Color3.fromRGB(255, 255, 255) CrossDot.BorderSizePixel = 0 CrossDot.Parent = CrosshairFrame -- ========================================== -- STRONA 1: MENU ZŁAP BLOK -- ========================================== local Page1Scroll = Instance.new("ScrollingFrame") Page1Scroll.Name = "Page1Scroll" Page1Scroll.Size = UDim2.new(1, -12, 1, -40) Page1Scroll.Position = UDim2.new(0, 6, 0, 34) Page1Scroll.BackgroundColor3 = Color3.fromRGB(32, 32, 35) Page1Scroll.BorderSizePixel = 1 Page1Scroll.BorderColor3 = Color3.fromRGB(65, 65, 70) Page1Scroll.ScrollBarThickness = 5 Page1Scroll.ScrollBarImageColor3 = Color3.fromRGB(160, 160, 165) Page1Scroll.CanvasSize = UDim2.new(0, 0, 0, 0) Page1Scroll.AutomaticCanvasSize = Enum.AutomaticSize.Y Page1Scroll.Visible = true Page1Scroll.Parent = MainFrame local ListLayout = Instance.new("UIListLayout") ListLayout.Padding = UDim.new(0, 6) ListLayout.SortOrder = Enum.SortOrder.LayoutOrder ListLayout.Parent = Page1Scroll local ListPadding = Instance.new("UIPadding") ListPadding.PaddingTop = UDim.new(0, 6) ListPadding.PaddingBottom = UDim.new(0, 6) ListPadding.PaddingLeft = UDim.new(0, 6) ListPadding.PaddingRight = UDim.new(0, 8) ListPadding.Parent = Page1Scroll local function SetOptionVisualOnly(stateKey, value) States[stateKey] = value local btn = OptionButtons[stateKey] if btn then if value then btn.Text = "ON" btn.BackgroundColor3 = Color3.fromRGB(35, 175, 65) else btn.Text = "OFF" btn.BackgroundColor3 = Color3.fromRGB(190, 40, 40) end end end local function CreateSquareOption(order, langKey, stateKey, onToggle) local OptionBox = Instance.new("Frame") OptionBox.Name = stateKey .. "_Box" OptionBox.LayoutOrder = order OptionBox.Size = UDim2.new(1, 0, 0, 34) OptionBox.BackgroundColor3 = Color3.fromRGB(15, 15, 17) OptionBox.BorderSizePixel = 1 OptionBox.BorderColor3 = Color3.fromRGB(60, 60, 65) OptionBox.Parent = Page1Scroll local Title = Instance.new("TextLabel") Title.Size = UDim2.new(1, -66, 1, 0) Title.Position = UDim2.new(0, 10, 0, 0) Title.BackgroundTransparency = 1 Title.Text = Translations[CurrentLang][langKey] Title.TextColor3 = Color3.fromRGB(240, 240, 240) Title.Font = Enum.Font.GothamSemibold Title.TextSize = 12 Title.TextXAlignment = Enum.TextXAlignment.Left Title.Parent = OptionBox OptionLabels[langKey] = Title local StatusBtn = Instance.new("TextButton") StatusBtn.Name = "StatusBtn" StatusBtn.Size = UDim2.new(0, 48, 0, 22) StatusBtn.Position = UDim2.new(1, -55, 0.5, -11) StatusBtn.BackgroundColor3 = Color3.fromRGB(190, 40, 40) StatusBtn.BorderSizePixel = 0 StatusBtn.Text = "OFF" StatusBtn.TextColor3 = Color3.fromRGB(255, 255, 255) StatusBtn.Font = Enum.Font.GothamBold StatusBtn.TextSize = 11 StatusBtn.Parent = OptionBox OptionButtons[stateKey] = StatusBtn TrackConnection(StatusBtn.MouseButton1Click:Connect(function() if scriptDestroyed then return end local nextVal = not States[stateKey] SetOptionVisualOnly(stateKey, nextVal) if onToggle then onToggle(nextVal) end end)) return OptionBox end local DistRow = Instance.new("Frame") DistRow.Name = "DistanceRow" DistRow.LayoutOrder = 2 DistRow.Size = UDim2.new(1, 0, 0, 34) DistRow.BackgroundColor3 = Color3.fromRGB(0, 145, 255) DistRow.BorderSizePixel = 1 DistRow.BorderColor3 = Color3.fromRGB(90, 185, 255) DistRow.Parent = Page1Scroll DistanceLabel = Instance.new("TextLabel") DistanceLabel.Size = UDim2.new(0, 74, 1, 0) DistanceLabel.Position = UDim2.new(0, 8, 0, 0) DistanceLabel.BackgroundTransparency = 1 DistanceLabel.Text = Translations[CurrentLang].distPrefix DistanceLabel.TextColor3 = Color3.fromRGB(255, 255, 255) DistanceLabel.Font = Enum.Font.GothamBold DistanceLabel.TextSize = 11 DistanceLabel.TextXAlignment = Enum.TextXAlignment.Left DistanceLabel.Parent = DistRow DistanceInput = Instance.new("TextBox") DistanceInput.Name = "DistanceInput" DistanceInput.Size = UDim2.new(0, 44, 0, 22) DistanceInput.Position = UDim2.new(0, 82, 0.5, -11) DistanceInput.BackgroundColor3 = Color3.fromRGB(12, 48, 96) DistanceInput.BorderSizePixel = 1 DistanceInput.BorderColor3 = Color3.fromRGB(165, 215, 255) DistanceInput.Text = tostring(HoldDistance) .. "m" DistanceInput.PlaceholderText = "m" DistanceInput.TextColor3 = Color3.fromRGB(255, 255, 255) DistanceInput.PlaceholderColor3 = Color3.fromRGB(185, 210, 235) DistanceInput.Font = Enum.Font.GothamBold DistanceInput.TextSize = 11 DistanceInput.ClearTextOnFocus = true DistanceInput.Parent = DistRow local MinusBtn = Instance.new("TextButton") MinusBtn.Size = UDim2.new(0, 24, 0, 22) MinusBtn.Position = UDim2.new(1, -56, 0.5, -11) MinusBtn.BackgroundColor3 = Color3.fromRGB(15, 75, 145) MinusBtn.BorderSizePixel = 0 MinusBtn.Text = "-" MinusBtn.TextColor3 = Color3.fromRGB(255, 255, 255) MinusBtn.Font = Enum.Font.GothamBold MinusBtn.TextSize = 13 MinusBtn.Parent = DistRow local PlusBtn = Instance.new("TextButton") PlusBtn.Size = UDim2.new(0, 24, 0, 22) PlusBtn.Position = UDim2.new(1, -28, 0.5, -11) PlusBtn.BackgroundColor3 = Color3.fromRGB(15, 75, 145) PlusBtn.BorderSizePixel = 0 PlusBtn.Text = "+" PlusBtn.TextColor3 = Color3.fromRGB(255, 255, 255) PlusBtn.Font = Enum.Font.GothamBold PlusBtn.TextSize = 13 PlusBtn.Parent = DistRow TrackConnection(DistanceInput.FocusLost:Connect(function() if scriptDestroyed then return end local cleaned = string.match(DistanceInput.Text or "", "%-?%d+") if not SetHoldDistanceValue(cleaned) then UpdateDistanceText() end end)) TrackConnection(MinusBtn.MouseButton1Click:Connect(function() if scriptDestroyed then return end SetHoldDistanceValue(HoldDistance - STEP_HOLD_DISTANCE) end)) TrackConnection(PlusBtn.MouseButton1Click:Connect(function() if scriptDestroyed then return end SetHoldDistanceValue(HoldDistance + STEP_HOLD_DISTANCE) end)) local function CreateStepRow(order, bgColor, borderColor, btnBgColor, leftSymbol, rightSymbol, onLeftClick, onRightClick) local RowBox = Instance.new("Frame") RowBox.LayoutOrder = order RowBox.Size = UDim2.new(1, 0, 0, 34) RowBox.BackgroundColor3 = bgColor RowBox.BorderSizePixel = 1 RowBox.BorderColor3 = borderColor RowBox.Parent = Page1Scroll local Lbl = Instance.new("TextLabel") Lbl.Size = UDim2.new(1, -76, 1, 0) Lbl.Position = UDim2.new(0, 10, 0, 0) Lbl.BackgroundTransparency = 1 Lbl.Text = "" Lbl.TextColor3 = Color3.fromRGB(255, 255, 255) Lbl.Font = Enum.Font.GothamBold Lbl.TextSize = 12 Lbl.TextXAlignment = Enum.TextXAlignment.Left Lbl.Parent = RowBox local LeftBtn = Instance.new("TextButton") LeftBtn.Size = UDim2.new(0, 26, 0, 22) LeftBtn.Position = UDim2.new(1, -62, 0.5, -11) LeftBtn.BackgroundColor3 = btnBgColor LeftBtn.BorderSizePixel = 0 LeftBtn.Text = leftSymbol LeftBtn.TextColor3 = Color3.fromRGB(255, 255, 255) LeftBtn.Font = Enum.Font.GothamBold LeftBtn.TextSize = 13 LeftBtn.Parent = RowBox local RightBtn = Instance.new("TextButton") RightBtn.Size = UDim2.new(0, 26, 0, 22) RightBtn.Position = UDim2.new(1, -32, 0.5, -11) RightBtn.BackgroundColor3 = btnBgColor RightBtn.BorderSizePixel = 0 RightBtn.Text = rightSymbol RightBtn.TextColor3 = Color3.fromRGB(255, 255, 255) RightBtn.Font = Enum.Font.GothamBold RightBtn.TextSize = 13 RightBtn.Parent = RowBox TrackConnection(LeftBtn.MouseButton1Click:Connect(function() if scriptDestroyed then return end if onLeftClick then onLeftClick() end end)) TrackConnection(RightBtn.MouseButton1Click:Connect(function() if scriptDestroyed then return end if onRightClick then onRightClick() end end)) return Lbl, LeftBtn, RightBtn end local DownHeightBtn, UpHeightBtn HeightLabel, DownHeightBtn, UpHeightBtn = CreateStepRow( 3, Color3.fromRGB(24, 24, 28), Color3.fromRGB(65, 65, 72), Color3.fromRGB(58, 58, 66), "↓", "↑", function() HeightOffset = math.max(MIN_HEIGHT_OFFSET, HeightOffset - STEP_HEIGHT_OFFSET) UpdateHeightText() end, function() HeightOffset = math.min(MAX_HEIGHT_OFFSET, HeightOffset + STEP_HEIGHT_OFFSET) UpdateHeightText() end ) local RotLeftBtn, RotRightBtn RotateLabel, RotLeftBtn, RotRightBtn = CreateStepRow( 4, Color3.fromRGB(24, 24, 28), Color3.fromRGB(65, 65, 72), Color3.fromRGB(58, 58, 66), "↶", "↷", function() ExtraYawDeg = (ExtraYawDeg - ROTATE_STEP_DEG) % 360 if ExtraYawDeg > 180 then ExtraYawDeg -= 360 end UpdateRotateText() end, function() ExtraYawDeg = (ExtraYawDeg + ROTATE_STEP_DEG) % 360 if ExtraYawDeg > 180 then ExtraYawDeg -= 360 end UpdateRotateText() end ) UpdateDistanceText() UpdateHeightText() UpdateRotateText() -- ========================================== -- STRONA 2: DŁUGA NOTATKA Z SUWAKIEM + WYBÓR JĘZYKA -- ========================================== local Page2Frame = Instance.new("Frame") Page2Frame.Name = "Page2Frame" Page2Frame.Size = UDim2.new(1, -12, 1, -40) Page2Frame.Position = UDim2.new(0, 6, 0, 34) Page2Frame.BackgroundColor3 = Color3.fromRGB(32, 32, 35) Page2Frame.BorderSizePixel = 1 Page2Frame.BorderColor3 = Color3.fromRGB(65, 65, 70) Page2Frame.Visible = false Page2Frame.Parent = MainFrame local LangBar = Instance.new("Frame") LangBar.Size = UDim2.new(1, -12, 0, 30) LangBar.Position = UDim2.new(0, 6, 0, 6) LangBar.BackgroundColor3 = Color3.fromRGB(15, 15, 17) LangBar.BorderSizePixel = 1 LangBar.BorderColor3 = Color3.fromRGB(60, 60, 65) LangBar.Parent = Page2Frame local LangHeader = Instance.new("TextLabel") LangHeader.Size = UDim2.new(1, -96, 1, 0) LangHeader.Position = UDim2.new(0, 8, 0, 0) LangHeader.BackgroundTransparency = 1 LangHeader.Text = Translations[CurrentLang].langHeader LangHeader.TextColor3 = Color3.fromRGB(220, 220, 225) LangHeader.Font = Enum.Font.GothamSemibold LangHeader.TextSize = 10 LangHeader.TextXAlignment = Enum.TextXAlignment.Left LangHeader.Parent = LangBar local BtnPL = Instance.new("TextButton") BtnPL.Size = UDim2.new(0, 38, 0, 20) BtnPL.Position = UDim2.new(1, -84, 0.5, -10) BtnPL.BackgroundColor3 = Color3.fromRGB(0, 145, 255) BtnPL.BorderSizePixel = 0 BtnPL.Text = "PL" BtnPL.TextColor3 = Color3.fromRGB(255, 255, 255) BtnPL.Font = Enum.Font.GothamBold BtnPL.TextSize = 10 BtnPL.Parent = LangBar local BtnEN = Instance.new("TextButton") BtnEN.Size = UDim2.new(0, 38, 0, 20) BtnEN.Position = UDim2.new(1, -42, 0.5, -10) BtnEN.BackgroundColor3 = Color3.fromRGB(50, 50, 55) BtnEN.BorderSizePixel = 0 BtnEN.Text = "EN" BtnEN.TextColor3 = Color3.fromRGB(255, 255, 255) BtnEN.Font = Enum.Font.GothamBold BtnEN.TextSize = 10 BtnEN.Parent = LangBar local NoteScroll = Instance.new("ScrollingFrame") NoteScroll.Name = "NoteScroll" NoteScroll.Size = UDim2.new(1, -12, 1, -48) NoteScroll.Position = UDim2.new(0, 6, 0, 42) NoteScroll.BackgroundColor3 = Color3.fromRGB(15, 15, 17) NoteScroll.BorderSizePixel = 1 NoteScroll.BorderColor3 = Color3.fromRGB(60, 60, 65) NoteScroll.ScrollBarThickness = 6 NoteScroll.ScrollBarImageColor3 = Color3.fromRGB(160, 160, 165) NoteScroll.CanvasSize = UDim2.new(0, 0, 0, 0) NoteScroll.AutomaticCanvasSize = Enum.AutomaticSize.Y NoteScroll.Parent = Page2Frame local NotePadding = Instance.new("UIPadding") NotePadding.PaddingTop = UDim.new(0, 8) NotePadding.PaddingBottom = UDim.new(0, 8) NotePadding.PaddingLeft = UDim.new(0, 8) NotePadding.PaddingRight = UDim.new(0, 12) NotePadding.Parent = NoteScroll local NoteLabel = Instance.new("TextLabel") NoteLabel.Size = UDim2.new(1, 0, 0, 0) NoteLabel.AutomaticSize = Enum.AutomaticSize.Y NoteLabel.BackgroundTransparency = 1 NoteLabel.Text = Translations[CurrentLang].noteText NoteLabel.TextColor3 = Color3.fromRGB(235, 235, 240) NoteLabel.Font = Enum.Font.Gotham NoteLabel.TextSize = 11 NoteLabel.TextWrapped = true NoteLabel.TextXAlignment = Enum.TextXAlignment.Left NoteLabel.TextYAlignment = Enum.TextYAlignment.Top NoteLabel.Parent = NoteScroll local function ApplyLanguage(lang) if scriptDestroyed then return end CurrentLang = (lang == "EN") and "EN" or "PL" local t = Translations[CurrentLang] SubtitleLabel.Text = SecondPageOpen and t.infoTitle or t.subtitle LangHeader.Text = t.langHeader NoteLabel.Text = t.noteText for key, lbl in pairs(OptionLabels) do lbl.Text = t[key] end UpdateDistanceText() UpdateHeightText() UpdateRotateText() if CurrentLang == "PL" then BtnPL.BackgroundColor3 = Color3.fromRGB(0, 145, 255) BtnEN.BackgroundColor3 = Color3.fromRGB(50, 50, 55) else BtnEN.BackgroundColor3 = Color3.fromRGB(0, 145, 255) BtnPL.BackgroundColor3 = Color3.fromRGB(50, 50, 55) end end TrackConnection(BtnPL.MouseButton1Click:Connect(function() ApplyLanguage("PL") end)) TrackConnection(BtnEN.MouseButton1Click:Connect(function() ApplyLanguage("EN") end)) TrackConnection(PageArrowBtn.MouseButton1Click:Connect(function() if scriptDestroyed then return end SecondPageOpen = not SecondPageOpen Page1Scroll.Visible = not SecondPageOpen Page2Frame.Visible = SecondPageOpen MainFrame.Size = INFO_BOARD_SIZE if SecondPageOpen then PageArrowBtn.Text = "<" SubtitleLabel.Text = Translations[CurrentLang].infoTitle else PageArrowBtn.Text = ">" SubtitleLabel.Text = Translations[CurrentLang].subtitle end end)) -- ========================================== -- LOGIKA CHWYCENIA FIZYCZNIE ODŁĄCZONYCH OBIEKTÓW -- ========================================== local MAX_AIM_DISTANCE = 450 local heldRootPart = nil local heldAssembly = {} local holdLocalOffset = Vector3.zero local lockedObjectRotation = CFrame.identity local pendingReleaseInput = false local function IsGrabActive() return States.GrabBlock end local function IsCharacterPart(part) for _, plr in ipairs(Players:GetPlayers()) do if plr.Character and part:IsDescendantOf(plr.Character) then return true end end return false end local function IsTerrainOrBaseplate(part) if part.Name == "Baseplate" or part.Name == "Terrain" then return true end if workspace.Terrain and part:IsDescendantOf(workspace.Terrain) then return true end return false end local function CollectDetachedAssembly(anchorCandidate) if not anchorCandidate or not anchorCandidate:IsA("BasePart") or not anchorCandidate.Parent then return nil end if anchorCandidate.Anchored or IsCharacterPart(anchorCandidate) or IsTerrainOrBaseplate(anchorCandidate) then return nil end local connected = anchorCandidate:GetConnectedParts(true) local assembly = {} local seen = {} local function addPart(p) if not p or not p:IsA("BasePart") or seen[p] then return true end if p.Anchored or IsCharacterPart(p) or IsTerrainOrBaseplate(p) then return false end seen[p] = true table.insert(assembly, p) return true end if not addPart(anchorCandidate) then return nil end for _, p in ipairs(connected) do if not addPart(p) then return nil end end for _, p in ipairs(assembly) do for _, joint in ipairs(p:GetJoints()) do if joint:IsA("JointInstance") then local other = (joint.Part0 == p) and joint.Part1 or joint.Part0 if other and other:IsA("BasePart") and other.Anchored then return nil end end end end return assembly end local function PickPrimaryRootPart(assembly, preferredPart) if preferredPart and preferredPart:IsA("BasePart") and preferredPart.Parent then if preferredPart.AssemblyRootPart and preferredPart.AssemblyRootPart:IsA("BasePart") and table.find(assembly, preferredPart.AssemblyRootPart) then return preferredPart.AssemblyRootPart end return preferredPart end local best = assembly[1] local bestVolume = -1 for _, p in ipairs(assembly) do local sz = p.Size local vol = sz.X * sz.Y * sz.Z if vol > bestVolume then bestVolume = vol best = p end end return best end local lastOwnershipClaim = 0 local function TryClaimPhysicsOwnership(assembly) local now = os.clock() if (now - lastOwnershipClaim) < 0.25 then return end lastOwnershipClaim = now pcall(function() if type(sethiddenproperty) == "function" then sethiddenproperty(LocalPlayer, "SimulationRadius", 4000) sethiddenproperty(LocalPlayer, "MaxSimulationRadius", 4000) end end) for _, p in ipairs(assembly or {}) do if p and p:IsA("BasePart") and p.Parent and not p.Anchored then pcall(function() if type(sethiddenproperty) == "function" then sethiddenproperty(p, "NetworkOwnershipAuto", false) sethiddenproperty(p, "NetworkOwner", LocalPlayer) end end) end end end local function ReleaseHeldObject() for _, p in ipairs(heldAssembly or {}) do if p and p.Parent and not p.Anchored then pcall(function() p.AssemblyLinearVelocity = Vector3.zero p.AssemblyAngularVelocity = Vector3.zero end) end end heldRootPart = nil heldAssembly = {} isHoldingObject = false pendingReleaseInput = false holdLocalOffset = Vector3.zero lockedObjectRotation = CFrame.identity end local function RaycastDetachedObject() local camera = workspace.CurrentCamera if not camera then return nil, nil, nil end local char = LocalPlayer.Character local rayOrigin = camera.CFrame.Position local rayDirection = camera.CFrame.LookVector * MAX_AIM_DISTANCE local params = RaycastParams.new() params.FilterType = Enum.RaycastFilterType.Exclude local filterList = {} if char then table.insert(filterList, char) end for _, p in ipairs(heldAssembly or {}) do if p and p.Parent then table.insert(filterList, p) end end params.FilterDescendantsInstances = filterList local result = workspace:Raycast(rayOrigin, rayDirection, params) if result and result.Instance then local assembly = CollectDetachedAssembly(result.Instance) if assembly and #assembly > 0 then local root = PickPrimaryRootPart(assembly, result.Instance) return root, assembly, result.Position end end return nil, nil, nil end local function ComputeDesiredCFrame(cameraCFrame) local desiredGrabPoint = cameraCFrame.Position + (cameraCFrame.LookVector * HoldDistance) + Vector3.new(0, HeightOffset, 0) local yawOnly = CFrame.fromEulerAnglesYXZ(0, select(2, cameraCFrame:ToEulerAnglesYXZ()), 0) local userRot = CFrame.Angles(math.rad(ExtraPitchDeg), math.rad(ExtraYawDeg), 0) local finalRot = yawOnly * userRot * lockedObjectRotation return CFrame.new(desiredGrabPoint) * finalRot - (finalRot * holdLocalOffset) end local function GrabDetachedObject(rootPart, assembly, hitPos, cameraCFrame) if not rootPart or not assembly or #assembly == 0 or not hitPos or not cameraCFrame then return false end heldRootPart = rootPart heldAssembly = assembly isHoldingObject = true pendingReleaseInput = false HeightOffset = 0 ExtraYawDeg = 0 ExtraPitchDeg = 0 UpdateHeightText() UpdateRotateText() holdLocalOffset = rootPart.CFrame:PointToObjectSpace(hitPos) lockedObjectRotation = rootPart.CFrame.Rotation lastOwnershipClaim = 0 TryClaimPhysicsOwnership(assembly) return true end TrackConnection(UserInputService.InputBegan:Connect(function(input, gameProcessed) if scriptDestroyed or not IsGrabActive() then return end if gameProcessed then return end if input.UserInputType == Enum.UserInputType.MouseButton2 then if isHoldingObject then ReleaseHeldObject() end elseif input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then if isHoldingObject then pendingReleaseInput = true else local camera = workspace.CurrentCamera local rootPart, assembly, hitPos = RaycastDetachedObject() if camera and rootPart and assembly and hitPos then GrabDetachedObject(rootPart, assembly, hitPos, camera.CFrame) end end end end)) TrackConnection(UserInputService.InputEnded:Connect(function(input) if scriptDestroyed then return end if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then if isHoldingObject and pendingReleaseInput then ReleaseHeldObject() end end end)) local function StepGrabSystem(dt) if scriptDestroyed or not IsGrabActive() then return end local camera = workspace.CurrentCamera if not camera then return end if isHoldingObject then CrossH.BackgroundColor3 = Color3.fromRGB(35, 175, 65) CrossV.BackgroundColor3 = Color3.fromRGB(35, 175, 65) if not heldRootPart or not heldRootPart.Parent or heldRootPart.Anchored then ReleaseHeldObject() return end local refreshedAssembly = CollectDetachedAssembly(heldRootPart) if refreshedAssembly and #refreshedAssembly > 0 then heldAssembly = refreshedAssembly end TryClaimPhysicsOwnership(heldAssembly) local desiredCf = ComputeDesiredCFrame(camera.CFrame) local currentCf = heldRootPart.CFrame local safeDt = math.clamp(dt, 1 / 120, 0.1) local posError = desiredCf.Position - currentCf.Position local linearVel = posError * 14 if linearVel.Magnitude > 220 then linearVel = linearVel.Unit * 220 end local rotDelta = desiredCf.Rotation * currentCf.Rotation:Inverse() local axis, angle = rotDelta:ToAxisAngle() if angle > math.pi then angle -= 2 * math.pi end local angVel = (axis.Magnitude > 1e-4) and (axis.Unit * math.clamp((angle / safeDt) * 0.45, -22, 22)) or Vector3.zero pcall(function() for _, p in ipairs(heldAssembly) do if p and p.Parent and not p.Anchored then p.AssemblyLinearVelocity = linearVel p.AssemblyAngularVelocity = angVel end end end) return end local aimedRoot, aimedAssembly, aimedPos = RaycastDetachedObject() if aimedRoot then CrossH.BackgroundColor3 = Color3.fromRGB(35, 175, 65) CrossV.BackgroundColor3 = Color3.fromRGB(35, 175, 65) GrabDetachedObject(aimedRoot, aimedAssembly, aimedPos, camera.CFrame) else CrossH.BackgroundColor3 = Color3.fromRGB(0, 145, 255) CrossV.BackgroundColor3 = Color3.fromRGB(0, 145, 255) end end local function SyncCrosshairAndHoldState() local active = IsGrabActive() CrosshairFrame.Visible = active if not active then ReleaseHeldObject() end end CreateSquareOption(1, "opt1", "GrabBlock", function() SyncCrosshairAndHoldState() end) TrackConnection(RunService.Heartbeat:Connect(function(dt) if scriptDestroyed then return end if type(dt) ~= "number" or dt <= 0 or dt ~= dt then dt = 1 / 60 end if IsGrabActive() then CrosshairFrame.Visible = true StepGrabSystem(dt) else CrosshairFrame.Visible = false if isHoldingObject or heldRootPart then ReleaseHeldObject() end end end)) TrackConnection(LocalPlayer.CharacterAdded:Connect(function() if scriptDestroyed then return end ReleaseHeldObject() end)) local function CleanupAllScriptResources() if scriptDestroyed then return end scriptDestroyed = true SetOptionVisualOnly("GrabBlock", false) CrosshairFrame.Visible = false ReleaseHeldObject() for _, conn in ipairs(globalConnections) do if conn and conn.Connected then conn:Disconnect() end end table.clear(globalConnections) if StatsGui then local statsRef = StatsGui StatsGui = nil if statsRef.Parent then statsRef:Destroy() end end if ScreenGui then local screenRef = ScreenGui ScreenGui = nil if screenRef.Parent then screenRef:Destroy() end end end TrackConnection(ScreenGui.Destroying:Connect(CleanupAllScriptResources)) TrackConnection(StatsGui.Destroying:Connect(CleanupAllScriptResources))