RobloxScripterAI
Discord ↗
Link Copied to Clipboard
×
"create a sprint system with a animation"
-- local script local player = game:GetService("Players").LocalPlayer local userInputService = game:GetService("UserInputService") local animation = Instance.new("Animation") animation.AnimationId = "rbxassetid://YourAnimationIDHere" -- replace with your animation id local function startSprint(input, gameProcessedEvent) if input.KeyCode == Enum.KeyCode.LeftShift and not gameProcessedEvent then player.Character.Humanoid.WalkSpeed = 50 local animationTrack = player.Character.Humanoid:LoadAnimation(animation) animationTrack:Play() end end local function stopSprint(input, gameProcessedEvent) if input.KeyCode == Enum.KeyCode.LeftShift then player.Character.Humanoid.WalkSpeed = 16 player.Character.Humanoid:StopAnimations() end end userInputService.InputBegan:Connect(startSprint) userInputService.InputEnded:Connect(stopSprint)