RobloxScripterAI
Discord ↗
Link Copied to Clipboard
×
"player dash. players dash when pressing Q and plays animation"
-- local script local Players = game:GetService("Players") local player = Players.LocalPlayer local character = player.Character or player.CharacterAdded:Wait() local humanoid = character:WaitForChild("Humanoid") local UserInputService = game:GetService("UserInputService") local animation = Instance.new("Animation") animation.AnimationId = "rbxassetid://your_animation_id_here" local function onInputBegan(input, gameProcessed) if input.KeyCode == Enum.KeyCode.Q and not gameProcessed then local dashSpeed = 50 local originalSpeed = humanoid.WalkSpeed humanoid.WalkSpeed = dashSpeed local animator = humanoid:WaitForChild("Animator") local animTrack = animator:LoadAnimation(animation) animTrack:Play() wait(0.5) humanoid.WalkSpeed = originalSpeed end end UserInputService.InputBegan:Connect(onInputBegan)