Backdash instead of frontdash

the script below is supossed to do a back dash when the player double taps S. though, if i do double tap S i do a front dash. can anyone help?

local plr = game.Players.LocalPlayer
local Char = plr.Character or plr.CharacterAdded:Wait()
local UserInputService = game:GetService("UserInputService")
local Tapped = false
local cd = false

UserInputService.InputBegan:Connect(function(Input, GameStuff)
	if cd == false then
		
		if GameStuff then return end
		if Input.KeyCode == Enum.KeyCode.S then
			if not Tapped then
				Tapped = true
				wait(0.3)
				Tapped = false
			else
				Char.HumanoidRootPart.Velocity = Char.HumanoidRootPart.CFrame.lookVector*330 
				cd=true
				local Animation = plr.Character:FindFirstChild("Humanoid"):LoadAnimation(script.Animation)
				Animation:Play()
				
				wait(2.5)
				cd = false
			end
		end
	end
end)

Maybe try making it negative?

Char.HumanoidRootPart.Velocity = -Char.HumanoidRootPart.CFrame.lookVector*330

This might not be the solution though, as I’m bad about physics.

2 Likes