Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do i perform an animation with a tool?

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

✓ Accepted answer

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)

2 comments

0

THANKS! spent two dayas trying to figure this you saved me , also thanks again dude

0

np

This discussion is preserved as it was. New answers, comments, and votes are closed.