I've created my own animation in the animation editor and when I try to play the animation it says that the animation failed to load. I have the ID from the url in the search bar.
Heres my code:
local Tool = script.Parent
local humanoid = nil
local drinker = nil
local con = nil
local enabled = false
function onEquipped(mouse)
humanoid = Tool.Parent:FindFirstChild("Humanoid")
if humanoid ~= nil then
drinker = humanoid:LoadAnimation(Tool.Animation)
end
con = mouse.Button1Down:connect(function() onButton1Down(mouse) end)
end
function onUnequipped(mouse)
humanoid = nil
if drinker ~= nil then
drinker:remove()
drinker = nil
end
if con ~= nil then
con:disconnect()
end
end
function onButton1Down(mouse)
if enabled then
return
end
enabled = true
drinker:Play()
wait(1)
enabled = false
end
Tool.Equipped:connect(onEquipped)
Tool.Unequipped:connect(onUnequipped)
