How to make hit animation play on tool

I’m making a tool which you can hit walls and they fall down but I don’t know how to detect when the player clicks to hit and then play the hit animation if anybody knows then it would be appreciated if you told me how.

1 Like

Do you mean when the player uses a tool? Tool | Roblox Creator Documentation

Yeah sorry I wasn’t clear enough.

idk if you solved this but

local tool = -- tool
 
function activated()
local humanoid = character:WaitForChild("Humanoid")
local animator = humanoid:WaitForChild("Animator")
local Animation = Instance.new("Animation")
Animation.AnimationId = "rbxassetid://000000000000" -- asset id
local AnimationPlay = animator:LoadAnimation(Animation)
AnimationPlay:Play()
end
 
tool.Activated:Connect(activated)

try that

1 Like