-- Place this in StarterPlayerTracks -> StarterPlayerScripts or StarterCharacterScripts local UserInputService = game:GetService("UserInputService") local TweenService = game:GetService("TweenService") local Players = game:GetService("Players") local player = Players.LocalPlayer local character = player.Character or player.CharacterAdded:Wait() local humanoidRootPart = character:WaitForChild("HumanoidRootPart") local humanoid = character:WaitForChild("Humanoid") -- Dash Configuration local DASH_DISTANCE = 25 local DASH_DURATION = 0.2 local COOLDOWN = 1.5 local isDashing = false local lastDashTime = 0 local function dash() local currentTime = os.clock() if isDashing or (currentTime - lastDashTime) < COOLDOWN then return end if humanoid.MoveDirection.Magnitude == 0 then return end -- Don't dash if standing still isDashing = true lastDashTime = currentTime -- Calculate dash direction based on where the player is moving local dashDirection = humanoid.MoveDirection.Unit local targetPosition = humanoidRootPart.Position + (dashDirection * DASH_DISTANCE) -- Smoothly move the player using a Tween local tweenInfo = TweenInfo.new(DASH_DURATION, Enum.EasingStyle.Quad, Enum.EasingDirection.Out) local goal = {CFrame = CFrame.new(targetPosition) * humanoidRootPart.CFrame.Rotation} local tween = TweenService:Create(humanoidRootPart, tweenInfo, goal) -- Temporary invulnerability or physics bypass could be added here tween:Play() tween.Completed:Connect(function() isDashing = false end) end -- Bind the dash to the "Q" key UserInputService.InputBegan:Connect(function(input, gameProcessed) if gameProcessed then return end -- Ignore inputs if typing in chat if input.KeyCode == Enum.KeyCode.Q then dash() end end)