Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do i perform an animation with a tool?

Asked by
Anto3oo 13
5 years ago

so yeah im back! with another question , sorry to bother you guys , okay well i want this tool to perform an animation when clicked but it doesnt work , i know that the click when tool equipped works because i got a playsound there , but i dont know what to do so the animation plays

local Tool = script.Parent

script.Parent.Activated:Connect(function()
 script.Parent.BRMM:Play()
 Tool.Parent.Humanoid:LoadAnimation(script.Attack)
script.Parent.Unequipped:Connect(function()
    script.Parent.BRMM:Stop()
end)
end)

thanks for reading!

1 answer

Log in to vote
0
Answered by 5 years ago

i dont think this is correct, but thats how i do it

script.Parent.Activated:Connect(function()
 script.Parent.BRMM:Play()
local animation = script.Parent.Parent.Humanoid:LoadAnimation(script.Attack) -- you didnt set "tool" to a correct variable, oof
animation:Play()
end)
script.Parent.Unequipped:Connect(function()
    script.Parent.BRMM:Stop()
end)
0
THANKS! spent two dayas trying to figure this you saved me , also thanks again dude Anto3oo 13 — 5y
0
np jdm4llfem8 94 — 5y
Ad

Answer this question