LucidScripts

DASH

Apr 20th, 2021 (edited)
462
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.59 KB | None | 0 0
  1. local Player = game.Players.LocalPlayer
  2. local Character = Player.Character
  3. local UIS = game:GetService("UserInputService")
  4. local plr = game.Players.LocalPlayer
  5. local Char = plr.Character or plr.CharacterAdded:Wait()
  6.  KeysDown={}
  7. CoolDown = 0.6
  8. local DashVal = 43
  9. debounce = true
  10. UIS.InputBegan:Connect(function(input,gpe)
  11.     if gpe then return end
  12.     if input.KeyCode == Enum.KeyCode.Q then
  13.         if debounce == false then return end
  14.         print("made true") 
  15.         if KeysDown.W then
  16.             if debounce == false then return end
  17.            
  18.             local AnimationId = "4639981048"
  19.                 local Anim = Instance.new("Animation")
  20.                 Anim.AnimationId = "rbxassetid://"..AnimationId
  21.                 local k = Char.Humanoid:LoadAnimation(Anim)
  22.                 k:Play()
  23.                 k:AdjustSpeed(1)
  24.            
  25.             local v9 = Instance.new("BodyVelocity", plr.Character.HumanoidRootPart);
  26.             v9.Name = "Dodge";
  27.             v9.MaxForce = Vector3.new(100000, 0, 100000);
  28.             v9.Velocity = (plr.Character.HumanoidRootPart.CFrame * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0))).lookVector * DashVal;
  29.             local v10 = Instance.new("ObjectValue", Char.Humanoid);
  30.             v10.Name = "Dash";
  31.             game.Debris:AddItem(v10, 3);
  32.             game.Debris:AddItem(v9, 0.25);
  33.         elseif KeysDown.D then
  34.             if debounce == false then return end
  35.  
  36.             local AnimationId = "4639982753"
  37.             local Anim = Instance.new("Animation")
  38.             Anim.AnimationId = "rbxassetid://"..AnimationId
  39.             local k = Char.Humanoid:LoadAnimation(Anim)
  40.             k:Play()
  41.             k:AdjustSpeed(1)
  42.  
  43.             local v15 = Instance.new("BodyVelocity", plr.Character.HumanoidRootPart);
  44.             v15.Name = "Dodge";
  45.             v15.MaxForce = Vector3.new(100000, 0, 100000);
  46.             v15.Velocity = (plr.Character.HumanoidRootPart.CFrame * CFrame.Angles(math.rad(0), math.rad(-90), math.rad(0))).lookVector * DashVal;
  47.             local v16 = Instance.new("ObjectValue", Char.Humanoid);
  48.             v16.Name = "Dash";
  49.             game.Debris:AddItem(v16, 3);
  50.             game.Debris:AddItem(v15, 0.25);
  51.         elseif KeysDown.A then
  52.             if debounce == false then return end
  53.  
  54.             local AnimationId = "4639982137"
  55.             local Anim = Instance.new("Animation")
  56.             Anim.AnimationId = "rbxassetid://"..AnimationId
  57.             local k = Char.Humanoid:LoadAnimation(Anim)
  58.             k:Play()
  59.             k:AdjustSpeed(1)
  60.  
  61.             local v15 = Instance.new("BodyVelocity", plr.Character.HumanoidRootPart);
  62.             v15.Name = "Dodge";
  63.             v15.MaxForce = Vector3.new(100000, 0, 100000);
  64.             v15.Velocity = (plr.Character.HumanoidRootPart.CFrame * CFrame.Angles(math.rad(0), math.rad(90), math.rad(0))).lookVector * DashVal;
  65.             local v16 = Instance.new("ObjectValue", Char.Humanoid);
  66.             v16.Name = "Dash";
  67.             game.Debris:AddItem(v16, 3);
  68.             game.Debris:AddItem(v15, 0.25);
  69.         elseif KeysDown.S then
  70.             if debounce == false then return end
  71.  
  72.             local AnimationId = "4639981642"
  73.             local Anim = Instance.new("Animation")
  74.             Anim.AnimationId = "rbxassetid://"..AnimationId
  75.             local k = Char.Humanoid:LoadAnimation(Anim)
  76.             k:Play()
  77.             k:AdjustSpeed(1)
  78.  
  79.             local v11 = Instance.new("BodyVelocity", plr.Character.HumanoidRootPart);
  80.             v11.Name = "Dodge";
  81.             v11.MaxForce = Vector3.new(100000, 0, 100000);
  82.             v11.Velocity = (plr.Character.HumanoidRootPart.CFrame * CFrame.Angles(math.rad(180), math.rad(0), math.rad(0))).lookVector * DashVal;
  83.             local v12 = Instance.new("ObjectValue", Char.Humanoid);
  84.             v12.Name = "Dash";
  85.             game.Debris:AddItem(v12, 3);
  86.             game.Debris:AddItem(v11, 0.25);
  87.         end    
  88.         debounce =false
  89.         wait(CoolDown)
  90.         debounce = true
  91.         print("made false")
  92.     else
  93.  
  94.         KeysDown[input.KeyCode.Name]=true  
  95.     end
  96. end)
  97.  
  98. UIS.InputEnded:Connect(function(input)
  99.     if input.UserInputType == Enum.UserInputType.Keyboard then
  100.         KeysDown[input.KeyCode.Name] = nil
  101.  
  102.     end
  103. end)
Add Comment
Please, Sign In to add comment