Advertisement
eguq8phqtr

Ice Walk Script

Jul 3rd, 2025
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.24 KB | None | 0 0
  1. local Players = cloneref and cloneref(game:GetService("Players")) or game:GetService("Players")
  2. local RunService = cloneref and cloneref(game:GetService("RunService")) or game:GetService("RunService")
  3. local plr = Players.LocalPlayer
  4. local char = plr.Character or plr.CharacterAdded:Wait()
  5. local hrp = char:WaitForChild("HumanoidRootPart")
  6. local hum = char:WaitForChild("Humanoid")
  7.  
  8. local ice_walk = true
  9. local slide_force = 180
  10. local friction = 0.9
  11.  
  12. hum.WalkSpeed = 16
  13.  
  14. local body_vel = Instance.new("BodyVelocity")
  15. body_vel.MaxForce = Vector3.new(1e5, 0, 1e5)
  16. body_vel.P = 1000
  17. body_vel.Velocity = Vector3.zero
  18. body_vel.Name = "IceSlide"
  19. body_vel.Parent = hrp
  20.  
  21. local current_velocity = Vector3.zero
  22.  
  23. RunService.RenderStepped:Connect(function(dt)
  24.     if not char or not char.Parent then return end
  25.     if ice_walk then
  26.         local move_dir = hum.MoveDirection
  27.         if move_dir.Magnitude > 0 then
  28.             current_velocity = current_velocity + move_dir.Unit * slide_force * dt
  29.         end
  30.         current_velocity = current_velocity * friction
  31.         body_vel.Velocity = Vector3.new(current_velocity.X, 0, current_velocity.Z)
  32.     else
  33.         current_velocity = Vector3.zero
  34.         body_vel.Velocity = Vector3.zero
  35.     end
  36. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement