The Dash is not working here, plus it only teleports not dash before it did not work
local UserInputService = game:GetService("UserInputService")
local Players = game:GetService("Players")
local LocalPlayer = Players.LocalPlayer
local Humanoid = LocalPlayer.Character:WaitForChild("Humanoid")
local dashSpeed = 50
local dashDuration = 0.5
local character = LocalPlayer.Character or LocalPlayer.CharacterAdded:Wait()
local humanoidRootPart = character:WaitForChild("HumanoidRootPart")
local dashAnimation = Instance.new("Animation")
dashAnimation.AnimationId = "rbxassetid://18271810196"
local dashAnimationTrack = Humanoid:LoadAnimation(dashAnimation)
local function dash(direction)
local currentCFrame = humanoidRootPart.CFrame
local dashDistance = direction * dashSpeed
local targetCFrame = currentCFrame + dashDistance
humanoidRootPart.CFrame = targetCFrame
dashAnimationTrack:Play()
task.wait(dashDuration)
end
local function onInputBegan(input, gameProcessed)
if gameProcessed then return end
if input.KeyCode == Enum.KeyCode.Q then
local characterDirection = humanoidRootPart.CFrame.LookVector
dash(characterDirection)
end
end
UserInputService.InputBegan:Connect(onInputBegan)