DoubleW = false UserInputService.InputBegan:Connect(function(Input, Touched) if not Touched then if Input.KeyCode == Enum.KeyCode.W and Enabled == true and Player.Backpack.Attributes.Armed.Value == true then local ray = Ray.new(HRP.CFrame.p, (HRP.CFrame * CFrame.new(0, -4, 0).p - HRP.CFrame.p).unit * 3) local ignore = {workspace.Map} local hit, position, normal = workspace:FindPartOnRayWithWhitelist(ray, ignore) if DoubleW == false then DoubleW = true spawn(function() wait(0.2) DoubleW = false end) elseif DoubleW == true and hit then local Smoke = Assets.Particles.Smoke2:Clone() Smoke.Parent = Character.LeftFoot Anims.DashFoward:Play() local BodyVelocity = Instance.new("BodyVelocity", HRP) BodyVelocity.MaxForce = Vector3.new(math.huge, math.huge, math.huge) BodyVelocity.Velocity = HRP.CFrame.lookVector * 50 game.Debris:AddItem(BodyVelocity, 0.2) Enabled = false spawn(function() wait(0.1) Smoke.Enbabled = false wait(0.1) game.Debris:AddItem(Smoke, 1) Anims.DashFoward:Stop() wait(0.6) Enabled = true end) end end end end) DoubleS = false UserInputService.InputBegan:Connect(function(Input, Touched) if not Touched then if Input.KeyCode == Enum.KeyCode.S and Enabled == true and Player.Backpack.Attributes.Armed.Value == true then local ray = Ray.new(HRP.CFrame.p, (HRP.CFrame * CFrame.new(0, -4, 0).p - HRP.CFrame.p).unit * 3) local ignore = {workspace.Map} local hit, position, normal = workspace:FindPartOnRayWithWhitelist(ray, ignore) if DoubleS == false and hit then spawn(function() wait(0.2) DoubleS = false end) elseif DoubleS == true and hit then local Smoke2 = Assets.Particles.Smoke2:Clone() Smoke2.Parent = Character.LeftFoot Anims.DashBackward:Play() local BodyVelocity = Instance.new("BodyVelocity", HRP) BodyVelocity.MaxForce = Vector3.new(math.huge, math.huge, math.huge) BodyVelocity.Velocity = HRP.CFrame.lookVector * - 50 game.Debris:AddItem(BodyVelocity, 0.2) Enabled = false spawn(function() wait(0.1) Smoke2.Enabled = false wait(0.1) game.Debris:AddItem(Smoke2, 1) Anims.DashBackward:Stop() wait(0.6) Enabled = true end) end end end end) DoubleA = false UserInputService.InputBegan:Connect(function(Input, Touched) if not Touched then if Input.KeyCode == Enum.KeyCode.A and Enabled == true and Player.Backpack.Attributes.Armed.Value == true then local ray = Ray.new(HRP.CFrame.p, (HRP.CFrame * CFrame.new(0, -4, 0).p - HRP.CFrame.p).unit * 3) local ignore = {workspace.Map} local hit, position, normal = workspace:FindPartOnRayWithWhitelist(ray, ignore) if DoubleA == false and hit then spawn(function() wait(0.2) DoubleA = false end) DoubleA = true elseif DoubleA == true and hit then local Smoke2 = Assets.Particles.Smoke2:Clone() Smoke2.Parent = Character.LeftFoot Anims.Dash1:Play() local BodyVelocity = Instance.new("BodyVelocity", HRP) BodyVelocity.MaxForce = Vector3.new(math.huge, math.huge, math.huge) BodyVelocity.Velocity = (HRP.CFrame * CFrame.Angles(0, math.rad(90), 0)).lookVector * 50 game.Debris:AddItem(BodyVelocity, 0.2) Enabled = false spawn(function() wait(0.1) Smoke2.Enabled = false wait(0.1) game.Debris:AddItem(Smoke2, 1) Anims.Dash1:Stop() wait(0.6) Enabled = true end) end end end end) DoubleD = false UserInputService.InputBegan:Connect(function(Input, Touched) if not Touched then if Input.KeyCode == Enum.KeyCode.D and Enabled == true and Player.Backpack.Attributes.Armed.Value == true then local ray = Ray.new(HRP.CFrame.p, (HRP.CFrame * CFrame.new(0, -4, 0).p - HRP.CFrame.p).unit * 3) local ignore = {workspace.Map} local hit, position, normal = workspace:FindPartOnRayWithWhitelist(ray, ignore) if DoubleD == false and hit then spawn(function() wait(0.2) DoubleD = false end) elseif DoubleD == true and hit then local Smoke2 = Assets.Particles.Smoke2:Clone() Smoke2.Parent = Character.RightFoot Anims.Dash2:Play() local BodyVelocity = Instance.new("BodyVelocity", HRP) BodyVelocity.MaxForce = Vector3.new(math.huge, math.huge, math.huge) BodyVelocity.Velocity = (HRP.CFrame * CFrame.Angles(0, math.rad(-90), 0)).lookVector * 50 game.Debris:AddItem(BodyVelocity, 0.2) Enabled = false spawn(function() wait(0.1) Smoke2.Enabled = false wait(0.1) game.Debris:AddItem(Smoke2, 1) Anims.Dash2:Stop() wait(0.6) Enabled = true end) end end end end)