There is no error in the script but the animation does not play. Here's the script

local UIS = game:GetService('UserInputService') local Player = game.Players.LocalPlayer local Character = Player.Character

UIS.InputBegan:connect(function(input)--When a player has pressed LeftShift it will play the animation and it will set the normal walking speed (16) to 35. if input.KeyCode == Enum.KeyCode.Space then local Anim = Instance.new('Animation') Anim.AnimationId = 'rbxassetid://3852227402' PlayAnim = Character.Humanoid:LoadAnimation(Anim) PlayAnim:Play() end end)

UIS.InputEnded:connect(function(input) if input.KeyCode == Enum.KeyCode.Space then PlayAnim:Stop() end end)