I made an animation script for a cup, and When the player has the tool equipped, and the player clicks it plays the animation. But it doesnt work.
things to know -- Animis the name of the animation and it is inside the script. Tool is a cup. here is my script
local Tool = script.Parent
local Anim = nil
local Ready = true
Tool.Activated:Connect(function()
if Tool.Parent.Humanoid.Health > 0 and Ready == true then
Ready = false
Anim = Tool.Parent.Humanoid:LoadAnimation(script:WaitForChild("Anim"))
Anim:Play()
wait(2)
Ready = true
end
end)
Tool.Unequipped:Connect(function()
if Anim then Anim:Stop() end
Ready = true
end)
