Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --// Services
- local Players = game:GetService("Players")
- local RunService = game:GetService("RunService")
- local UserInputService = game:GetService("UserInputService")
- local LocalPlayer = Players.LocalPlayer
- local PlayerGui = LocalPlayer:WaitForChild("PlayerGui")
- --// Core Settings
- local Settings = {
- Enabled = true,
- Range = 12.1,
- MinRange = 1,
- MaxRange = 50,
- SwingSpeed = 0.000000000001,
- SwingAmplitude = 0.0000000001,
- ThrottleDelay = 0,
- }
- local trackedLimbs = {}
- --// Setup character visuals
- local function setupCharacterParts(character)
- for _, part in ipairs(character:GetDescendants()) do
- if part:IsA("BasePart") then
- part.LocalTransparencyModifier = 0
- part.Massless = true
- end
- end
- end
- local function setupCharacter(player, character)
- trackedLimbs[player] = nil
- setupCharacterParts(character)
- end
- local function detachAndTrack(character, player)
- if trackedLimbs[player] then return end
- local torso = character:FindFirstChild("Torso")
- if not torso then return end
- trackedLimbs[player] = {}
- local function detach(limbName, jointName)
- local joint = torso:FindFirstChild(jointName)
- local limb = character:FindFirstChild(limbName)
- if joint and joint:IsA("Motor6D") and limb then
- joint:Destroy()
- limb.Anchored = true
- limb.Massless = true
- limb.Transparency = 1
- trackedLimbs[player][limbName] = limb
- end
- end
- detach("Right Arm", "Right Shoulder")
- detach("Left Arm", "Left Shoulder")
- detach("Right Leg", "Right Hip")
- detach("Left Leg", "Left Hip")
- end
- local function getHandle()
- local char = LocalPlayer.Character
- if not char then return nil end
- for _, tool in ipairs(char:GetChildren()) do
- if tool:IsA("Tool") then
- return tool:FindFirstChild("Handle")
- end
- end
- return nil
- end
- --// UI Setup
- local screenGui = Instance.new("ScreenGui")
- screenGui.Name = "Reach_UI"
- screenGui.ResetOnSpawn = false
- screenGui.IgnoreGuiInset = true
- screenGui.Parent = PlayerGui
- -- Open/Close Button
- local openButton = Instance.new("TextButton")
- openButton.Size = UDim2.new(0, 40, 0, 40)
- openButton.Position = UDim2.new(0, 10, 0.5, -20)
- openButton.Text = "≡"
- openButton.Font = Enum.Font.GothamBold
- openButton.TextSize = 20
- openButton.BackgroundColor3 = Color3.fromRGB(35, 35, 35)
- openButton.TextColor3 = Color3.fromRGB(255, 255, 255)
- openButton.Parent = screenGui
- -- Main Frame
- local mainFrame = Instance.new("Frame")
- mainFrame.Size = UDim2.new(0, 320, 0, 220)
- mainFrame.Position = UDim2.new(0, 60, 0.5, -110)
- mainFrame.BackgroundColor3 = Color3.fromRGB(25, 25, 25)
- mainFrame.Visible = true
- mainFrame.Active = true
- mainFrame.Draggable = true
- mainFrame.Parent = screenGui
- local stroke = Instance.new("UIStroke", mainFrame)
- stroke.Color = Color3.fromRGB(0, 255, 255)
- stroke.Thickness = 2
- -- Tabs
- local tabButtons = {}
- local tabs = {}
- local function createTab(name)
- local tabBtn = Instance.new("TextButton")
- tabBtn.Size = UDim2.new(0, 100, 0, 30)
- tabBtn.Position = UDim2.new(0, 10 + (#tabButtons * 105), 0, 10)
- tabBtn.Text = name
- tabBtn.Font = Enum.Font.GothamBold
- tabBtn.TextSize = 16
- tabBtn.BackgroundColor3 = Color3.fromRGB(0, 170, 170)
- tabBtn.TextColor3 = Color3.new(1, 1, 1)
- tabBtn.Parent = mainFrame
- local tabFrame = Instance.new("Frame")
- tabFrame.Size = UDim2.new(1, -20, 1, -50)
- tabFrame.Position = UDim2.new(0, 10, 0, 40)
- tabFrame.BackgroundTransparency = 1
- tabFrame.Visible = false
- tabFrame.Parent = mainFrame
- tabBtn.MouseButton1Click:Connect(function()
- for _, frame in pairs(tabs) do frame.Visible = false end
- tabFrame.Visible = true
- end)
- table.insert(tabButtons, tabBtn)
- table.insert(tabs, tabFrame)
- return tabFrame
- end
- -- Main Tab Content
- local reachTab = createTab("Main")
- tabs[1].Visible = true
- -- Toggle (circle style)
- local toggleCircle = Instance.new("TextButton")
- toggleCircle.Size = UDim2.new(0, 40, 0, 40)
- toggleCircle.Position = UDim2.new(0, 10, 0, 10)
- toggleCircle.Text = ""
- toggleCircle.BackgroundColor3 = Settings.Enabled and Color3.fromRGB(0, 255, 100) or Color3.fromRGB(255, 0, 0)
- toggleCircle.BorderSizePixel = 0
- toggleCircle.AutoButtonColor = false
- toggleCircle.Parent = reachTab
- Instance.new("UICorner", toggleCircle)
- local toggleLabel = Instance.new("TextLabel")
- toggleLabel.Size = UDim2.new(0, 100, 0, 40)
- toggleLabel.Position = UDim2.new(0, 60, 0, 10)
- toggleLabel.Text = "Reach: " .. (Settings.Enabled and "ON" or "OFF")
- toggleLabel.TextColor3 = Color3.new(1, 1, 1)
- toggleLabel.BackgroundTransparency = 1
- toggleLabel.Font = Enum.Font.Gotham
- toggleLabel.TextSize = 18
- toggleLabel.TextXAlignment = Enum.TextXAlignment.Left
- toggleLabel.Parent = reachTab
- toggleCircle.MouseButton1Click:Connect(function()
- Settings.Enabled = not Settings.Enabled
- toggleCircle.BackgroundColor3 = Settings.Enabled and Color3.fromRGB(0, 255, 100) or Color3.fromRGB(255, 0, 0)
- toggleLabel.Text = "Reach: " .. (Settings.Enabled and "ON" or "OFF")
- end)
- -- Slider
- local sliderLabel = Instance.new("TextLabel")
- sliderLabel.Size = UDim2.new(0, 280, 0, 20)
- sliderLabel.Position = UDim2.new(0, 10, 0, 60)
- sliderLabel.Text = "Reach Distance: " .. Settings.Range
- sliderLabel.TextColor3 = Color3.new(1, 1, 1)
- sliderLabel.BackgroundTransparency = 1
- sliderLabel.Font = Enum.Font.Gotham
- sliderLabel.TextSize = 16
- sliderLabel.Parent = reachTab
- local sliderFrame = Instance.new("Frame")
- sliderFrame.Size = UDim2.new(0, 280, 0, 20)
- sliderFrame.Position = UDim2.new(0, 10, 0, 90)
- sliderFrame.BackgroundColor3 = Color3.fromRGB(50, 50, 50)
- sliderFrame.BorderSizePixel = 0
- sliderFrame.Parent = reachTab
- local fill = Instance.new("Frame")
- fill.Size = UDim2.new(0, 0, 1, 0)
- fill.BackgroundColor3 = Color3.fromRGB(0, 200, 255)
- fill.BorderSizePixel = 0
- fill.Parent = sliderFrame
- local draggable = Instance.new("TextButton")
- draggable.Size = UDim2.new(0, 10, 1, 0)
- draggable.Position = UDim2.new(0, 0, 0, 0)
- draggable.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
- draggable.BorderSizePixel = 0
- draggable.Text = ""
- draggable.Parent = sliderFrame
- -- Drag logic
- local dragging = false
- local function updateSlider(posX)
- local relativeX = math.clamp(posX - sliderFrame.AbsolutePosition.X, 0, sliderFrame.AbsoluteSize.X)
- local percent = relativeX / sliderFrame.AbsoluteSize.X
- local newValue = Settings.MinRange + (Settings.MaxRange - Settings.MinRange) * percent
- Settings.Range = newValue
- sliderLabel.Text = string.format("Reach Distance: %.1f", newValue)
- fill.Size = UDim2.new(percent, 0, 1, 0)
- draggable.Position = UDim2.new(0, relativeX - 5, 0, 0)
- end
- draggable.InputBegan:Connect(function(input)
- if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
- dragging = true
- end
- end)
- UserInputService.InputChanged:Connect(function(input)
- if dragging then
- updateSlider(input.Position.X)
- end
- end)
- UserInputService.InputEnded:Connect(function(input)
- if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
- dragging = false
- end
- end)
- -- Open/Close toggle
- openButton.MouseButton1Click:Connect(function()
- mainFrame.Visible = not mainFrame.Visible
- end)
- -- Character and Player Setup
- Players.PlayerRemoving:Connect(function(player)
- trackedLimbs[player] = nil
- end)
- for _, player in ipairs(Players:GetPlayers()) do
- if player.Character then setupCharacter(player, player.Character) end
- player.CharacterAdded:Connect(function(character)
- setupCharacter(player, character)
- end)
- end
- Players.PlayerAdded:Connect(function(player)
- player.CharacterAdded:Connect(function(character)
- setupCharacter(player, character)
- end)
- end)
- -- Main Loop
- local lastUpdate = 0
- RunService.Heartbeat:Connect(function()
- if not Settings.Enabled then return end
- local currentTime = tick()
- if currentTime - lastUpdate < Settings.ThrottleDelay then return end
- lastUpdate = currentTime
- local handle = getHandle()
- if not handle then return end
- for _, player in ipairs(Players:GetPlayers()) do
- if player ~= LocalPlayer and player.Character then
- local hrp = player.Character:FindFirstChild("HumanoidRootPart")
- local humanoid = player.Character:FindFirstChild("Humanoid")
- if not hrp or not humanoid then continue end
- local dist = (handle.Position - hrp.Position).Magnitude
- if not trackedLimbs[player] and dist <= Settings.Range then
- detachAndTrack(player.Character, player)
- end
- if dist >= Settings.MinRange and dist <= Settings.Range then
- local isJumping = humanoid:GetState() == Enum.HumanoidStateType.Jumping or humanoid:GetState() == Enum.HumanoidStateType.Freefall
- if not isJumping then
- for _, part in ipairs(player.Character:GetDescendants()) do
- if part:IsA("BasePart") then
- firetouchinterest(handle, part, 0)
- firetouchinterest(handle, part, 1)
- end
- end
- end
- end
- end
- end
- for player, limbs in pairs(trackedLimbs) do
- local character = player.Character
- if character then
- local hrp = character:FindFirstChild("HumanoidRootPart")
- local humanoid = character:FindFirstChild("Humanoid")
- if hrp and humanoid then
- local dist = (handle.Position - hrp.Position).Magnitude
- if dist >= Settings.MinRange and dist <= Settings.Range then
- local airborne = humanoid:GetState() == Enum.HumanoidStateType.Jumping or humanoid:GetState() == Enum.HumanoidStateType.Freefall
- for _, limb in pairs(limbs) do
- if limb and limb.Parent then
- local osc = math.sin(tick() * Settings.SwingSpeed) * Settings.SwingAmplitude
- local offset = Vector3.new(osc, 0, 0)
- local verticalOffset = airborne and Vector3.new(0, 2, 0) or Vector3.new(0, 0, 0)
- local newPos = handle.Position + offset + verticalOffset
- limb.Anchored = false
- limb.CFrame = CFrame.lookAt(newPos, handle.Position)
- firetouchinterest(handle, limb, 0)
- firetouchinterest(handle, limb, 1)
- limb.Anchored = true
- end
- end
- end
- end
- end
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment