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

why doesnt the walk animation change even though it prints it is changed in the output?

Asked by 7 years ago
game:GetService('UserInputService').InputBegan:connect(function(input)
    if input.KeyCode == Enum.KeyCode.LeftControl then
        Rlooping = true

        toolNone.AnimationId = 'http://www.roblox.com/asset/?id=476682284'
        walk.AnimationId = 'http://www.roblox.com/asset/?id=476653440'
        print(walk.AnimationId)
        humanoid.WalkSpeed = 80
    elseif
         input.KeyCode == Enum.KeyCode.LeftControl and toolNone.AnimationId == 'http://www.roblox.com/asset/?id=476682284' and walk.AnimationId == 'http://www.roblox.com/asset/?id=476653440' then
        toolNone.AnimationId = 'http://www.roblox.com/asset/?id=448766294'

        walk.AnimationId = 'http://www.roblox.com/asset/?id=476341652'
        humanoid.WalkSpeed = 16
    end
end)

the code works for a few seconds after i click the button, and it doesnt revert to the old animation when it is clicked again

Answer this question