Hi scripters. I’m fairly new to scripting, but something is weird with the tools I am trying to play an animation on. Basically, when I place the tool in starter pack and equip it and click, the animation works. When click a button to get it from replicated storage, the animation doesn’t work when I click. As you can see in the script below, I made it so it will print something and it doesn’t do that when I get it from replicated storage. This is really weird and I don’t know what to do. Keep in mind the animation is right as it works when it’s from the starter pack.
This is the script I’m currently using:
local Tool = script.Parent
local EatAnimation = Tool.EatAnimation
Tool.Activated:Connect(function()
print("activated")
local Character = Tool.Parent
local AnimationTrack = Character.Humanoid.Animator:LoadAnimation(EatAnimation)
repeat task.wait() until AnimationTrack.Length > 0.05
AnimationTrack:Play()
end)
The script probably isn’t how you would expect it to be but that is because I tried recoding it multiple times just for me to find out it works from the starterpack but not when I am given the tool from replicated storage. If anyone can help me with this problem, that would be amazing.