Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

I can't seem to figure out how to add a running animation to the sprint button. Can anyone help me?

Asked by 4 years ago

I found a script where I can toggle LeftCTRL to sprint, But does anyone know how to add a custom running animation to this?

local player = game.Players.LocalPlayer
local humanoid = player.Character.Humanoid

local UIS = game:GetService("UserInputService")

UIS.InputBegan:Connect(function(input)
    if input.KeyCode == Enum.KeyCode.LeftControl then
        if  humanoid.WalkSpeed == 35 then
            humanoid.WalkSpeed = 16
        else
            humanoid.WalkSpeed = 35
        end
    end
end)
0
You would have to load the animation onto the Humanoid then and play the animation. https://developer.roblox.com/en-us/api-reference/function/Humanoid/LoadAnimation AntiWorldliness 868 — 4y
0
Sorry but, where would I put that code? toompske 12 — 4y

Answer this question