local UIS = game:GetService('UserInputService')
local Player = game.Players.LocalPlayer
local Character = Player.Character
UIS.InputBegan:connect(function(input)
if input.KeyCode == Enum.KeyCode.W or input.KeyCode == Enum.KeyCode.A then
Character.Humanoid.WalkSpeed = 22 --run speed
local Anim = Instance.new('Animation')
Anim.AnimationId = 'rbxassetid://18686242456'
PlayAnim = Character.Humanoid:LoadAnimation(Anim)
PlayAnim:Play()
end
end)
UIS.InputEnded:connect(function(input)
if input.KeyCode == Enum.KeyCode.W or input.KeyCode == Enum.KeyCode.A then
Character.Humanoid.WalkSpeed = 16 --default walk speed
PlayAnim:Stop()
end
end)
I’m not sure how to fix this.
1