Animation Code NOT working

Also make sure that it’s a local script and not a server script.

It is a localscript, yes. eeee

local Parent = script.Parent
local Animation = Instance.new("Animation", Parent)
local AnimationLoad
Animation.AnimationId = "rbxassetid://13288897462"
Parent.Equipped:Connect(function(Mouse)
	Mouse.Icon = ""
	local Toggled = false
	AnimationLoad = Parent.Parent:WaitForChild("Humanoid"):WaitForChild("Animator"):LoadAnimation(Animation)
	Mouse.Button1Down:connect(function()
		if Toggled then
			AnimationLoad:Stop()
			Toggled = false
		else
			AnimationLoad:Play()
			Toggled = true
		end
	end)
end)
Parent.Unequipped:Connect(function()
	if AnimationLoad then AnimationLoad:Stop() end
end)

Doesn’t work… eeeeeeeeeeeeeeee

Are you sure the link to the animation is correct?

Yes. It is. (Sorry, went to sleep.)

Sorry I haven’t worked with Tools for a long time.I just realized something. Disable RequiresHandle in the tool and I think that’ll fix the issue.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.