Walking and Running

While scrolling through the animation script I noticed a walk animation. How can I make it so just holding [w] will make me walk and holding shift will make me sprint?

7 Likes

Holding shift to sprint is as simple as changing the player walkspeed when the player presses the shift key using the context action service or the user input service, I believe this also reflects changes in the animation as well

https://developer.roblox.com/en-us/api-reference/property/Humanoid/WalkSpeed

----using IsKeyDown (example)
local UIS = game:GetService("UserInputService")
local Humanoid = game.player.LocalPlayer.Character.Humanoid

local DefualtWalkSpeed = 16
local RunningWalkSpeed = 30

while true do 
  wait(0.1)
   if UIS:IsKeyDown(enum.KeyCode.LeftShift) then

Humanoid.WalkSpeed = RunningWalkSpeed 

else 
Humanoid.WalkSpeed = DefualtWalkSpeed 
  end

end
5 Likes

As @Jaycbee05 Said it is as simple as changing the walkspeed, You can have a look at this script to see how it works.
Hope I helped you and your welcome to contact me if you have anymore.
-Jake
@TheYelloMacaroni

Iā€™m having trouble with the animations, I want to make so that it only plays when the players is moving and pressing shift at the same time, what is the solution for that?

Hi @SneakyyOrange This is indeed the incorrect topic but I will still happily help you out. If you have a look here you should find all the relevant information you need.
Hope I helped you and your welcome to contact me if you have anymore.
-Jake