Animation script not working?
Hey i want to know what is the error in this script? Its supposed to play an animation when u press k, i tried both in studio, both in game to press the k button but no animation played. Maybe im typing in ID, wrong?
01 | local player = game.Players.LocalPlayer |
02 | local char = game.Workspace:WaitForChild(player.Name) |
03 | local humanoid = char:WaitForChild( "Humanoid" ) |
04 | local animation = Instance.new( "Animation" , player) |
05 | animation.AnimationId = "296883490" |
06 | local animTrack = humanoid:LoadAnimation(animation) |
07 | local uis = game:GetSerice( "UserInputService" ) |
08 | uis.InputBegan:connect( function (key) |
09 | if key.KeyCode = = Enum.KeyCode.K then |