So basically I was making a mmorpg game like sword burst 2 but it's a village with Dragon, I was trying to make a Animations in a Tool like running animation while holding it and idle and so much more but there's a problem cause it doesn't seem to work i copied a tutorial on YouTube here's the link (https://youtu.be/jr6dRmaj6xI) but it doesn't seem to work i tried everything, If anyone could help me please reply here asap, Thank you!
TO play an animation, you need to load it into a humanoid. I didn't bother watching the video you showed, so if this isn't what you're looking for, then welp.
local player = game.Players.LocalPlayer script.Parent.Activated:Connect(function() --//Plays the animation every time a player clicks with the tool equipped local anim = player.Character.Humanoid:LoadAnimation(script.Parent.Animation) anim:Play() end)
Basically, to play an animation you do:
local player = game.Players.LocalPlayer local anim = player.Character.Humanoid:LoadAnimation(script.Parent.Animation) anim:Play()
local Tool = nil local AnimScript = nil script.Parent.Equipped:Connect(function() Tool = script.Parent AnimScript = Tool.Parent:WaitForChild("Animate") AnimScript:WaitForChild("toolnone"):WaitForChild("ToolNoneAnim") AnimScript.toolnone.ToolNoneAnim.AnimationId = "rbxassetid://5283297823" end) script.Parent.Unequipped:Connect(function() AnimScript:WaitForChild("toolnone"):WaitForChild("ToolNoneAnim") AnimScript.toolnone.ToolNoneAnim.AnimationId = "rbxassetid://" end)