I basically just want an animation to be played in the player once the part is clicked.
- I am using a LocalScript and Script since my original script didn't work (from the Wiki)
- The animation is made by me
My code:
Local script:
local Animation = Instance.new("Animation", game.Players.LocalPlayer.Character)
Animation.AnimationId = 1293869333 -- Animation ID goes here
local Anim = game.Players.LocalPlayer.Character.Humanoid:LoadAnimation(Animation)
wait(.1) -- A delay of 0.1 Secs
Anim.Priority = Enum.AnimationPriority.Core
Script:
script.Parent.ClickDetector.MouseClick:connect(function(Player) -- Player is the player.. (what clicked)
local Character = Player.Character -- We get the player's character
local s = script.Parent -- We reference the parent of this script
local New = s.LocalScript:Clone() -- We clone the LocalScript
New.Parent = Player.Character -- We parent it to the Character so it executes
end)
Anyone know why my code isn't working? I have tried so many different ways to make it work but it never does. This is what is printed out in the output: 19:30:29.475 - Animation "1293869333" failed to load in "Workspace.Florian27.Animation.AnimationId": Animation failed to load
