here's the script;
local Punch = script.Parent function onActivation() print("Tool activated") wait() local Humanoid = Punch.Parent:WaitForChild("Humanoid") local CloneAnime = game.ReplicatedStorage.Animation.Humanoid:Clone() end Punch.Activated:connect(onActivation)
I just don't know where to place LoadAnimation() then Play(). Please help.
You've got most of it right, but one thing - there's no need to clone the animation.
Use the LoadAnimation
function on 'Humanoid' after line 7 to retrieve the animation's AnimationTrack . Then use the Play
function on the AnimationTrack.
local Punch = script.Parent; local Animation = game.ReplicatedStorage.Animation; function onActivation() print("Tool activated") local Humanoid = Punch.Parent:WaitForChild("Humanoid") local anim = Humanoid:LoadAnimation(Animation); anim:Play(); end Punch.Activated:connect(onActivation)