Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Animation script is not working properly, please help? Inga me

local Player = game.Players.LocalPlayer

local UIP = game:GetService("UserInputService")

  

UIP.InputBegan:Connect(function(Key)

if Key.KeyCode.Name == Enum.KeyCode.LeftShift then

local Animation = Instance.new("Animation")

local ID = "rbxassetid://"..2907090579

Animation.AnimationId = ID

Animation.Parent = Player.Character.Humanoid

Player.Character.Humanoid:LoadAnimation(Animation)

Animation:Play()

end

end)

It never loads. And does not play.

1 answer

You aren't obtaining the AnimationTrack from the LoadAnimation function that allow you to play the animation.

Animation = player.Character.Humanoid:LoadAnimation(Animation)

Animation:Play()

This discussion is preserved as it was. New answers, comments, and votes are closed.