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

Why can't i load my animation into a character?

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)

1 answer

✓ Accepted answer

Here's a way I found to fix it. Add an animation to workspace, put in the code you are using into the ID, and it will change to a different one. Copy and paste that one instead of the one you used.

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