-- Dynamic Distance Offset COM Slider for Delta print("[COM] Initializing dynamic distance slider...") local Players = game:GetService("Players") local UserInputService = game:GetService("UserInputService") local CoreGui = game:GetService("CoreGui") local Player = Players.LocalPlayer local container = (gethui and gethui()) or CoreGui if container:FindFirstChild("COMSliderMobile") then container.COMSliderMobile:Destroy() end local ScreenGui = Instance.new("ScreenGui") ScreenGui.Name = "COMSliderMobile" ScreenGui.ResetOnSpawn = false ScreenGui.Parent = container local Frame = Instance.new("Frame") Frame.Size = UDim2.new(0, 240, 0, 165) Frame.Position = UDim2.new(0.05, 0, 0.3, 0) Frame.BackgroundColor3 = Color3.fromRGB(25, 25, 35) Frame.Active = true Frame.Draggable = true Frame.Parent = ScreenGui Instance.new("UICorner", Frame).CornerRadius = UDim.new(0, 8) local Title = Instance.new("TextLabel") Title.Size = UDim2.new(1, 0, 0, 30) Title.BackgroundTransparency = 1 Title.Text = "⚖️ COM Intensity: 1" Title.TextColor3 = Color3.fromRGB(255, 215, 0) Title.Font = Enum.Font.SourceSansBold Title.TextSize = 14 Title.Parent = Frame -- Toggle Button local ToggleBtn = Instance.new("TextButton") ToggleBtn.Size = UDim2.new(0.85, 0, 0, 32) ToggleBtn.Position = UDim2.new(0.075, 0, 0, 36) ToggleBtn.BackgroundColor3 = Color3.fromRGB(180, 50, 50) ToggleBtn.TextColor3 = Color3.fromRGB(255, 255, 255) ToggleBtn.Text = "🔴 Status: OFF" ToggleBtn.Font = Enum.Font.SourceSansBold ToggleBtn.TextSize = 13 ToggleBtn.Parent = Frame Instance.new("UICorner", ToggleBtn).CornerRadius = UDim.new(0, 6) -- Slider Track Background local SliderBG = Instance.new("Frame") SliderBG.Size = UDim2.new(0.85, 0, 0, 22) SliderBG.Position = UDim2.new(0.075, 0, 0, 82) SliderBG.BackgroundColor3 = Color3.fromRGB(50, 50, 65) SliderBG.Parent = Frame Instance.new("UICorner", SliderBG).CornerRadius = UDim.new(0, 10) -- Slider Fill Bar local SliderFill = Instance.new("Frame") SliderFill.Size = UDim2.new(0, 0, 1, 0) SliderFill.BackgroundColor3 = Color3.fromRGB(255, 215, 0) SliderFill.Parent = SliderBG Instance.new("UICorner", SliderFill).CornerRadius = UDim.new(0, 10) -- Slider Knob Button local Knob = Instance.new("Frame") Knob.Size = UDim2.new(0, 26, 0, 26) Knob.Position = UDim2.new(0, -13, 0.5, -13) Knob.BackgroundColor3 = Color3.fromRGB(255, 255, 255) Knob.Parent = SliderBG Instance.new("UICorner", Knob).CornerRadius = UDim.new(0, 13) local Hint = Instance.new("TextLabel") Hint.Size = UDim2.new(1, 0, 0, 20) Hint.Position = UDim2.new(0, 0, 0, 122) Hint.BackgroundTransparency = 1 Hint.Text = "1 (Close) ➔ 1000 (Far Pull)" Hint.TextColor3 = Color3.fromRGB(160, 160, 160) Hint.Font = Enum.Font.SourceSans Hint.TextSize = 11 Hint.Parent = Frame local isEnabled = false local currentMultiplier = 1 local sliding = false local activePart = nil local activeWeld = nil local function cleanupPart() if activePart then activePart:Destroy() activePart = nil end if activeWeld then activeWeld:Destroy() activeWeld = nil end end local function spawnPart(multiplier) cleanupPart() pcall(function() local char = Player.Character local hrp = char and char:FindFirstChild("HumanoidRootPart") if not hrp then return end local part = Instance.new("Part") part.Name = "COM_Weight_Dynamic" part.Size = Vector3.new(2, 2, 2) part.Transparency = 0.5 part.CanCollide = false part.Massless = false -- Maximum density to ensure strong physics pull part.CustomPhysicalProperties = PhysicalProperties.new(100, 0.3, 0.5) part.Parent = char -- Scale offset distance based on multiplier (from 1 stud out to 15 studs out) local distance = 1 + (multiplier / 1000) * 14 local weld = Instance.new("Weld") weld.Part0 = hrp weld.Part1 = part -- Shift the C1 offset outward dynamically weld.C0 = CFrame.new() weld.C1 = CFrame.new(0, 2, -distance) weld.Parent = hrp activePart = part activeWeld = weld end) end local function updateFromTouch(posX) local bgX = SliderBG.AbsolutePosition.X local bgW = SliderBG.AbsoluteSize.X local ratio = math.clamp((posX - bgX) / bgW, 0, 1) Knob.Position = UDim2.new(ratio, -13, 0.5, -13) SliderFill.Size = UDim2.new(ratio, 0, 1, 0) currentMultiplier = math.floor(ratio * 999 + 1) Title.Text = "⚖️ COM Intensity: " .. currentMultiplier -- If active, dynamically update the weld distance offset live if isEnabled and activeWeld then pcall(function() local distance = 1 + (currentMultiplier / 1000) * 14 activeWeld.C1 = CFrame.new(0, 2, -distance) end) end end SliderBG.InputBegan:Connect(function(input) if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then sliding = true updateFromTouch(input.Position.X) end end) UserInputService.InputEnded:Connect(function(input) if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then sliding = false end end) UserInputService.InputChanged:Connect(function(input) if sliding and (input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch) then updateFromTouch(input.Position.X) end end) ToggleBtn.MouseButton1Click:Connect(function() isEnabled = not isEnabled if isEnabled then ToggleBtn.Text = "🟢 Status: ON" ToggleBtn.BackgroundColor3 = Color3.fromRGB(50, 150, 80) spawnPart(currentMultiplier) else ToggleBtn.Text = "🔴 Status: OFF" ToggleBtn.BackgroundColor3 = Color3.fromRGB(180, 50, 50) cleanupPart() end end) print("[COM] Dynamic Slider Ready!")