Mr_3242

Wall climber

Jun 19th, 2026
24
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.82 KB | Gaming | 0 0
  1. local Players = game:GetService("Players")
  2. local RunService = game:GetService("RunService")
  3.  
  4. local player = Players.LocalPlayer
  5.  
  6. -- SETTINGS
  7. local BASE_POS = UDim2.new(0, 12, 0, 12)
  8. local CLIMB_SPEED = 18
  9. local REENTER_WINDOW = 1
  10. local LEVITATE_TIME = 0.5
  11. local RAY_DISTANCE = 3
  12.  
  13. -- GUI
  14. local gui = Instance.new("ScreenGui")
  15. gui.Name = "WallClimbGui"
  16. gui.ResetOnSpawn = false
  17. gui.Parent = player:WaitForChild("PlayerGui")
  18.  
  19. local frame = Instance.new("Frame")
  20. frame.Size = UDim2.new(0, 200, 0, 45)
  21. frame.Position = BASE_POS
  22. frame.BackgroundColor3 = Color3.fromRGB(22, 22, 24)
  23. frame.BorderSizePixel = 0
  24. frame.Parent = gui
  25.  
  26. local corner = Instance.new("UICorner")
  27. corner.CornerRadius = UDim.new(0, 8)
  28. corner.Parent = frame
  29.  
  30. local stroke = Instance.new("UIStroke")
  31. stroke.Thickness = 1
  32. stroke.Color = Color3.fromRGB(80, 80, 90)
  33. stroke.Transparency = 0.5
  34. stroke.Parent = frame
  35.  
  36. local button = Instance.new("TextButton")
  37. button.Size = UDim2.new(1, -10, 1, -10)
  38. button.Position = UDim2.new(0, 5, 0, 5)
  39. button.BackgroundColor3 = Color3.fromRGB(35, 35, 38)
  40. button.TextColor3 = Color3.fromRGB(255, 255, 255)
  41. button.Text = "Wall Climb: OFF"
  42. button.Font = Enum.Font.GothamSemibold
  43. button.TextSize = 14
  44. button.BorderSizePixel = 0
  45. button.Parent = frame
  46.  
  47. local enabled = false
  48.  
  49. button.MouseButton1Click:Connect(function()
  50.     enabled = not enabled
  51.     button.Text = enabled and "Wall Climb: ON" or "Wall Climb: OFF"
  52.     button.BackgroundColor3 = enabled and Color3.fromRGB(45, 80, 45)
  53.         or Color3.fromRGB(35, 35, 38)
  54. end)
  55.  
  56. local connection
  57.  
  58. local function setNoclip(char, state)
  59.     for _, v in ipairs(char:GetDescendants()) do
  60.         if v:IsA("BasePart") then
  61.             v.CanCollide = not state
  62.         end
  63.     end
  64. end
  65.  
  66. local function setup(char)
  67.     if connection then
  68.         connection:Disconnect()
  69.     end
  70.  
  71.     local humanoid = char:WaitForChild("Humanoid")
  72.     local root = char:WaitForChild("HumanoidRootPart")
  73.  
  74.     local rayParams = RaycastParams.new()
  75.     rayParams.FilterType = Enum.RaycastFilterType.Exclude
  76.     rayParams.FilterDescendantsInstances = {char}
  77.  
  78.     -- STATE
  79.     local wasTouching = false
  80.     local lastExitTime = 0
  81.     local reenterCooldown = 0
  82.  
  83.     local levitating = false
  84.     local levitateEnd = 0
  85.  
  86.     connection = RunService.Heartbeat:Connect(function(dt)
  87.         if not char.Parent then return end
  88.         if not enabled then
  89.             setNoclip(char, false)
  90.             return
  91.         end
  92.  
  93.         local state = humanoid:GetState()
  94.         local inAir =
  95.             state == Enum.HumanoidStateType.Freefall
  96.             or state == Enum.HumanoidStateType.Jumping
  97.  
  98.         if not inAir then
  99.             levitating = false
  100.             setNoclip(char, false)
  101.             return
  102.         end
  103.  
  104.         -- wall detection
  105.         local hit = workspace:Raycast(root.Position, root.CFrame.LookVector * RAY_DISTANCE, rayParams)
  106.         local touching = hit ~= nil
  107.         local now = os.clock()
  108.  
  109.         -- EXIT WALL
  110.         if wasTouching and not touching then
  111.             lastExitTime = now
  112.             reenterCooldown = now + 0.15 -- prevents double-wall spam
  113.             setNoclip(char, false)
  114.         end
  115.  
  116.         -- RE-ENTRY PENALTY
  117.         if touching and not wasTouching then
  118.             if now > reenterCooldown and (now - lastExitTime) < REENTER_WINDOW then
  119.                 levitating = true
  120.                 levitateEnd = now + LEVITATE_TIME
  121.             end
  122.         end
  123.  
  124.         wasTouching = touching
  125.  
  126.         -- LEVITATION MODE
  127.         if levitating then
  128.             setNoclip(char, true)
  129.  
  130.             if now >= levitateEnd then
  131.                 levitating = false
  132.                 setNoclip(char, false)
  133.             else
  134.                 -- smooth hover (NO CFrame spam)
  135.                 root.AssemblyLinearVelocity = Vector3.new(0, 6, 0)
  136.                 return
  137.             end
  138.         end
  139.  
  140.         -- CLIMB MODE
  141.         if touching then
  142.             setNoclip(char, true)
  143.  
  144.             local vel = root.AssemblyLinearVelocity
  145.             root.AssemblyLinearVelocity = Vector3.new(0, math.max(vel.Y, 0), 0)
  146.  
  147.             root.CFrame = root.CFrame + Vector3.new(0, CLIMB_SPEED * dt, 0)
  148.         else
  149.             setNoclip(char, false)
  150.         end
  151.     end)
  152. end
  153.  
  154. if player.Character then
  155.     setup(player.Character)
  156. end
  157.  
  158. player.CharacterAdded:Connect(setup)
Tags: delta
Advertisement
Add Comment
Please, Sign In to add comment