burkistudio

Roblox Slide Script

Sep 9th, 2023
1,154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.19 KB | Gaming | 0 0
  1. -- PUT THIS SCRIPT TO STARTERCHARACTER SCRIPTS!
  2. -- Made By burkistudio
  3.  
  4. local UIS = game:GetService("UserInputService")
  5. local char = script.Parent
  6.  
  7. local slideAnim = Instance.new("Animation")
  8. slideAnim.AnimationId = "rbxassetid://14636040337" -- Enter your AnimtionID
  9.  
  10. local sound = Instance.new("Sound")
  11. sound.Name = "Sliding"
  12. sound.SoundId = "rbxassetid://4953056011"
  13. sound.Parent = script.Parent
  14. sound.TimePosition = 0.5
  15.  
  16. local keybind = Enum.KeyCode.LeftControl -- between the key for ability
  17. local canslide = true
  18.  
  19. UIS.InputBegan:Connect(function(input,gameprocessed)
  20.     if gameprocessed then return end
  21.     if not canslide then return end
  22.    
  23.     if input.KeyCode == keybind then
  24.         canslide = false
  25.         sound.TimePosition = 0.5
  26.        
  27.         local playAnim = char.Humanoid:LoadAnimation(slideAnim)
  28.         playAnim:Play()
  29.         sound:Play()
  30.         local slide = Instance.new("BodyVelocity")
  31.         slide.MaxForce = Vector3.new(1,0,1) * 12500
  32.         slide.Velocity = char.HumanoidRootPart.CFrame.lookVector * 100
  33.         slide.Parent = char.HumanoidRootPart
  34.        
  35.         for count = 1, 8 do
  36.             wait(0.1)
  37.             slide.Velocity*= 0.7
  38.         end
  39.         sound:Stop()
  40.         playAnim:Stop()
  41.         slide:Destroy()
  42.         wait(0.5)
  43.         canslide = true
  44.     end
  45. end)
  46.  
Advertisement
Add Comment
Please, Sign In to add comment