Kenken_I

Untitled

Jun 13th, 2025
28
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.92 KB | None | 0 0
  1. --// Services
  2. local Players = game:GetService("Players")
  3. local RunService = game:GetService("RunService")
  4. local UserInputService = game:GetService("UserInputService")
  5. local LocalPlayer = Players.LocalPlayer
  6. local PlayerGui = LocalPlayer:WaitForChild("PlayerGui")
  7.  
  8. --// Core Settings
  9. local Settings = {
  10. Enabled = true,
  11. Range = 12.1,
  12. MinRange = 1,
  13. MaxRange = 50,
  14. SwingSpeed = 0.000000000001,
  15. SwingAmplitude = 0.0000000001,
  16. ThrottleDelay = 0,
  17. }
  18.  
  19. local trackedLimbs = {}
  20.  
  21. --// Setup character visuals
  22. local function setupCharacterParts(character)
  23. for _, part in ipairs(character:GetDescendants()) do
  24. if part:IsA("BasePart") then
  25. part.LocalTransparencyModifier = 0
  26. part.Massless = true
  27. end
  28. end
  29. end
  30.  
  31. local function setupCharacter(player, character)
  32. trackedLimbs[player] = nil
  33. setupCharacterParts(character)
  34. end
  35.  
  36. local function detachAndTrack(character, player)
  37. if trackedLimbs[player] then return end
  38. local torso = character:FindFirstChild("Torso")
  39. if not torso then return end
  40. trackedLimbs[player] = {}
  41.  
  42. local function detach(limbName, jointName)
  43. local joint = torso:FindFirstChild(jointName)
  44. local limb = character:FindFirstChild(limbName)
  45. if joint and joint:IsA("Motor6D") and limb then
  46. joint:Destroy()
  47. limb.Anchored = true
  48. limb.Massless = true
  49. limb.Transparency = 1
  50. trackedLimbs[player][limbName] = limb
  51. end
  52. end
  53.  
  54. detach("Right Arm", "Right Shoulder")
  55. detach("Left Arm", "Left Shoulder")
  56. detach("Right Leg", "Right Hip")
  57. detach("Left Leg", "Left Hip")
  58. end
  59.  
  60. local function getHandle()
  61. local char = LocalPlayer.Character
  62. if not char then return nil end
  63. for _, tool in ipairs(char:GetChildren()) do
  64. if tool:IsA("Tool") then
  65. return tool:FindFirstChild("Handle")
  66. end
  67. end
  68. return nil
  69. end
  70.  
  71. --// UI Setup
  72. local screenGui = Instance.new("ScreenGui")
  73. screenGui.Name = "Reach_UI"
  74. screenGui.ResetOnSpawn = false
  75. screenGui.IgnoreGuiInset = true
  76. screenGui.Parent = PlayerGui
  77.  
  78. -- Open/Close Button
  79. local openButton = Instance.new("TextButton")
  80. openButton.Size = UDim2.new(0, 40, 0, 40)
  81. openButton.Position = UDim2.new(0, 10, 0.5, -20)
  82. openButton.Text = "≡"
  83. openButton.Font = Enum.Font.GothamBold
  84. openButton.TextSize = 20
  85. openButton.BackgroundColor3 = Color3.fromRGB(35, 35, 35)
  86. openButton.TextColor3 = Color3.fromRGB(255, 255, 255)
  87. openButton.Parent = screenGui
  88.  
  89. -- Main Frame
  90. local mainFrame = Instance.new("Frame")
  91. mainFrame.Size = UDim2.new(0, 320, 0, 220)
  92. mainFrame.Position = UDim2.new(0, 60, 0.5, -110)
  93. mainFrame.BackgroundColor3 = Color3.fromRGB(25, 25, 25)
  94. mainFrame.Visible = true
  95. mainFrame.Active = true
  96. mainFrame.Draggable = true
  97. mainFrame.Parent = screenGui
  98.  
  99. local stroke = Instance.new("UIStroke", mainFrame)
  100. stroke.Color = Color3.fromRGB(0, 255, 255)
  101. stroke.Thickness = 2
  102.  
  103. -- Tabs
  104. local tabButtons = {}
  105. local tabs = {}
  106.  
  107. local function createTab(name)
  108. local tabBtn = Instance.new("TextButton")
  109. tabBtn.Size = UDim2.new(0, 100, 0, 30)
  110. tabBtn.Position = UDim2.new(0, 10 + (#tabButtons * 105), 0, 10)
  111. tabBtn.Text = name
  112. tabBtn.Font = Enum.Font.GothamBold
  113. tabBtn.TextSize = 16
  114. tabBtn.BackgroundColor3 = Color3.fromRGB(0, 170, 170)
  115. tabBtn.TextColor3 = Color3.new(1, 1, 1)
  116. tabBtn.Parent = mainFrame
  117.  
  118. local tabFrame = Instance.new("Frame")
  119. tabFrame.Size = UDim2.new(1, -20, 1, -50)
  120. tabFrame.Position = UDim2.new(0, 10, 0, 40)
  121. tabFrame.BackgroundTransparency = 1
  122. tabFrame.Visible = false
  123. tabFrame.Parent = mainFrame
  124.  
  125. tabBtn.MouseButton1Click:Connect(function()
  126. for _, frame in pairs(tabs) do frame.Visible = false end
  127. tabFrame.Visible = true
  128. end)
  129.  
  130. table.insert(tabButtons, tabBtn)
  131. table.insert(tabs, tabFrame)
  132.  
  133. return tabFrame
  134. end
  135.  
  136. -- Main Tab Content
  137. local reachTab = createTab("Main")
  138. tabs[1].Visible = true
  139.  
  140. -- Toggle (circle style)
  141. local toggleCircle = Instance.new("TextButton")
  142. toggleCircle.Size = UDim2.new(0, 40, 0, 40)
  143. toggleCircle.Position = UDim2.new(0, 10, 0, 10)
  144. toggleCircle.Text = ""
  145. toggleCircle.BackgroundColor3 = Settings.Enabled and Color3.fromRGB(0, 255, 100) or Color3.fromRGB(255, 0, 0)
  146. toggleCircle.BorderSizePixel = 0
  147. toggleCircle.AutoButtonColor = false
  148. toggleCircle.Parent = reachTab
  149. Instance.new("UICorner", toggleCircle)
  150.  
  151. local toggleLabel = Instance.new("TextLabel")
  152. toggleLabel.Size = UDim2.new(0, 100, 0, 40)
  153. toggleLabel.Position = UDim2.new(0, 60, 0, 10)
  154. toggleLabel.Text = "Reach: " .. (Settings.Enabled and "ON" or "OFF")
  155. toggleLabel.TextColor3 = Color3.new(1, 1, 1)
  156. toggleLabel.BackgroundTransparency = 1
  157. toggleLabel.Font = Enum.Font.Gotham
  158. toggleLabel.TextSize = 18
  159. toggleLabel.TextXAlignment = Enum.TextXAlignment.Left
  160. toggleLabel.Parent = reachTab
  161.  
  162. toggleCircle.MouseButton1Click:Connect(function()
  163. Settings.Enabled = not Settings.Enabled
  164. toggleCircle.BackgroundColor3 = Settings.Enabled and Color3.fromRGB(0, 255, 100) or Color3.fromRGB(255, 0, 0)
  165. toggleLabel.Text = "Reach: " .. (Settings.Enabled and "ON" or "OFF")
  166. end)
  167.  
  168. -- Slider
  169. local sliderLabel = Instance.new("TextLabel")
  170. sliderLabel.Size = UDim2.new(0, 280, 0, 20)
  171. sliderLabel.Position = UDim2.new(0, 10, 0, 60)
  172. sliderLabel.Text = "Reach Distance: " .. Settings.Range
  173. sliderLabel.TextColor3 = Color3.new(1, 1, 1)
  174. sliderLabel.BackgroundTransparency = 1
  175. sliderLabel.Font = Enum.Font.Gotham
  176. sliderLabel.TextSize = 16
  177. sliderLabel.Parent = reachTab
  178.  
  179. local sliderFrame = Instance.new("Frame")
  180. sliderFrame.Size = UDim2.new(0, 280, 0, 20)
  181. sliderFrame.Position = UDim2.new(0, 10, 0, 90)
  182. sliderFrame.BackgroundColor3 = Color3.fromRGB(50, 50, 50)
  183. sliderFrame.BorderSizePixel = 0
  184. sliderFrame.Parent = reachTab
  185.  
  186. local fill = Instance.new("Frame")
  187. fill.Size = UDim2.new(0, 0, 1, 0)
  188. fill.BackgroundColor3 = Color3.fromRGB(0, 200, 255)
  189. fill.BorderSizePixel = 0
  190. fill.Parent = sliderFrame
  191.  
  192. local draggable = Instance.new("TextButton")
  193. draggable.Size = UDim2.new(0, 10, 1, 0)
  194. draggable.Position = UDim2.new(0, 0, 0, 0)
  195. draggable.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  196. draggable.BorderSizePixel = 0
  197. draggable.Text = ""
  198. draggable.Parent = sliderFrame
  199.  
  200. -- Drag logic
  201. local dragging = false
  202. local function updateSlider(posX)
  203. local relativeX = math.clamp(posX - sliderFrame.AbsolutePosition.X, 0, sliderFrame.AbsoluteSize.X)
  204. local percent = relativeX / sliderFrame.AbsoluteSize.X
  205. local newValue = Settings.MinRange + (Settings.MaxRange - Settings.MinRange) * percent
  206. Settings.Range = newValue
  207. sliderLabel.Text = string.format("Reach Distance: %.1f", newValue)
  208. fill.Size = UDim2.new(percent, 0, 1, 0)
  209. draggable.Position = UDim2.new(0, relativeX - 5, 0, 0)
  210. end
  211.  
  212. draggable.InputBegan:Connect(function(input)
  213. if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
  214. dragging = true
  215. end
  216. end)
  217.  
  218. UserInputService.InputChanged:Connect(function(input)
  219. if dragging then
  220. updateSlider(input.Position.X)
  221. end
  222. end)
  223.  
  224. UserInputService.InputEnded:Connect(function(input)
  225. if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
  226. dragging = false
  227. end
  228. end)
  229.  
  230. -- Open/Close toggle
  231. openButton.MouseButton1Click:Connect(function()
  232. mainFrame.Visible = not mainFrame.Visible
  233. end)
  234.  
  235. -- Character and Player Setup
  236. Players.PlayerRemoving:Connect(function(player)
  237. trackedLimbs[player] = nil
  238. end)
  239.  
  240. for _, player in ipairs(Players:GetPlayers()) do
  241. if player.Character then setupCharacter(player, player.Character) end
  242. player.CharacterAdded:Connect(function(character)
  243. setupCharacter(player, character)
  244. end)
  245. end
  246.  
  247. Players.PlayerAdded:Connect(function(player)
  248. player.CharacterAdded:Connect(function(character)
  249. setupCharacter(player, character)
  250. end)
  251. end)
  252.  
  253. -- Main Loop
  254. local lastUpdate = 0
  255. RunService.Heartbeat:Connect(function()
  256. if not Settings.Enabled then return end
  257. local currentTime = tick()
  258. if currentTime - lastUpdate < Settings.ThrottleDelay then return end
  259. lastUpdate = currentTime
  260.  
  261. local handle = getHandle()
  262. if not handle then return end
  263.  
  264. for _, player in ipairs(Players:GetPlayers()) do
  265. if player ~= LocalPlayer and player.Character then
  266. local hrp = player.Character:FindFirstChild("HumanoidRootPart")
  267. local humanoid = player.Character:FindFirstChild("Humanoid")
  268. if not hrp or not humanoid then continue end
  269.  
  270. local dist = (handle.Position - hrp.Position).Magnitude
  271. if not trackedLimbs[player] and dist <= Settings.Range then
  272. detachAndTrack(player.Character, player)
  273. end
  274.  
  275. if dist >= Settings.MinRange and dist <= Settings.Range then
  276. local isJumping = humanoid:GetState() == Enum.HumanoidStateType.Jumping or humanoid:GetState() == Enum.HumanoidStateType.Freefall
  277. if not isJumping then
  278. for _, part in ipairs(player.Character:GetDescendants()) do
  279. if part:IsA("BasePart") then
  280. firetouchinterest(handle, part, 0)
  281. firetouchinterest(handle, part, 1)
  282. end
  283. end
  284. end
  285. end
  286. end
  287. end
  288.  
  289. for player, limbs in pairs(trackedLimbs) do
  290. local character = player.Character
  291. if character then
  292. local hrp = character:FindFirstChild("HumanoidRootPart")
  293. local humanoid = character:FindFirstChild("Humanoid")
  294. if hrp and humanoid then
  295. local dist = (handle.Position - hrp.Position).Magnitude
  296. if dist >= Settings.MinRange and dist <= Settings.Range then
  297. local airborne = humanoid:GetState() == Enum.HumanoidStateType.Jumping or humanoid:GetState() == Enum.HumanoidStateType.Freefall
  298. for _, limb in pairs(limbs) do
  299. if limb and limb.Parent then
  300. local osc = math.sin(tick() * Settings.SwingSpeed) * Settings.SwingAmplitude
  301. local offset = Vector3.new(osc, 0, 0)
  302. local verticalOffset = airborne and Vector3.new(0, 2, 0) or Vector3.new(0, 0, 0)
  303. local newPos = handle.Position + offset + verticalOffset
  304. limb.Anchored = false
  305. limb.CFrame = CFrame.lookAt(newPos, handle.Position)
  306. firetouchinterest(handle, limb, 0)
  307. firetouchinterest(handle, limb, 1)
  308. limb.Anchored = true
  309. end
  310. end
  311. end
  312. end
  313. end
  314. end
  315. end)
Advertisement
Add Comment
Please, Sign In to add comment