local UIS = game:GetService('UserInputService')
local Player = game.Players.LocalPlayer
local Character = Player.Character
UIS.InputBegan:connect(function(input)
if input.KeyCode == Enum.KeyCode.LeftControl then
Character.Humanoid.WalkSpeed = 35
end
end)
If you want to do the animation, you can simply play in Studio, go to your character and copy the “Animate” LocalScript, stop the game and paste that script into StarterCharacterScripts, after you can change the Running animation value to your running animation ID, and you’ll be set.
local IsRunning = false
UIS.InputBegan:connect(function(input)
if input.KeyCode == Enum.KeyCode.LeftControl then
IsRunning = not IsRunning
if IsRunning == true then
Character.Humanoid.WalkSpeed = 35
else
Character.Humanoid.WalkSpeed = 15
end
end
end)
Thank you, but for the animation I thought I could simply change the default run animation to a new one. But as always it’s never that simple and didn’t work.
No.
So what you do is, press Play, go to your character and copy the “Animate” script
End game, then paste the script into StarterPlayer>StarterCharacterScripts
Expand the script and look for “run” expand that and then you will see “RunAnim” change the AnimationId to your animation.