RobloxScripterAI
Discord ↗
Link Copied to Clipboard
×
"make a sprint script where the player moves faster with custom animation where to put it aswell"
You can create a sprint script with a custom animation by following these steps: 1. Upload your custom animation to Roblox and get the animation ID. 2. Create a local script inside StarterPlayer > StarterPlayerScripts. 3. Use the following code in the local script, replacing "YourAnimationIDHere" with your custom animation ID. ```lua local Players = game:GetService("Players") 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://YourAnimationIDHere" local animationTrack = humanoid:LoadAnimation(animation) local sprinting = false local function onInput(input, gameProcessed) if input.KeyCode == Enum.KeyCode.LeftShift and not gameProcessed then if sprinting then sprinting = false humanoid.WalkSpeed = 16 animationTrack:Stop() else sprinting = true humanoid.WalkSpeed = 30 animationTrack:Play() end end end game:GetService("UserInputService").InputBegan:Connect(onInput) ``` This script will make the player sprint with the custom animation when the left shift key is pressed. The player's walk speed will also increase while sprinting.