How Do You Make The Animation Play? Note: This script is inside a tool. The tool has a handle. The sounds and animation is inside the handle.
function onEquip() script.Parent.Handle.UnsheathSound:Play() end function onActivate() script.Parent.Handle.SlashSound:Play() script.Parent.Handle.Animation:Play() end script.Parent.Equipped:connect(onEquip) script.Parent.Activated:connect(onActivate)
You have to create a 'Animation' then load it into the Humanoid then Play it. So for example
local Animation = Instance.new('Animation')
Of course this creates the Animation itself.
animation.AnimationId = "http://www.roblox.com/Asset?ID="
Add the animation ID to the string after the "=". This loads the animation from the website and puts it into the newly created Animation.
local animTrack = Humanoid:LoadAnimation(animation)
The method name really says it all, it loads the animation into the humanoid.
animTrack:Play()
Now play the animation, and you're in business.