RobloxScripterAI
Discord ↗
Link Copied to Clipboard
×
"player dash. players dash when pressing Q and plays animation"
-- local script local Players = game:GetService("Players") local UserInputService = game:GetService("UserInputService") local player = Players.LocalPlayer local character = player.Character or player.CharacterAdded:Wait() local humanoid = character:WaitForChild("Humanoid") local animation = Instance.new("Animation") animation.AnimationId = "rbxassetid://your_animation_id_here" -- Replace with your animation ID local loadedAnimation = humanoid:LoadAnimation(animation) local function onInputBegan(input, gameProcessedEvent) if input.KeyCode == Enum.KeyCode.Q and not gameProcessedEvent then humanoid.WalkSpeed = 50 -- Increase walk speed for dash loadedAnimation:Play() wait(0.5) -- Adjust the duration of the dash humanoid.WalkSpeed = 16 -- Reset walk speed to normal end end UserInputService.InputBegan:Connect(onInputBegan)