I want to make it so when a user clicks, the animation runs - but unfortunately I get this error that prevents this from occurring, how may I fix this issue? Here’s the line:
script.Parent.Equipped(function(mouse)
mouse.Button1Down:Connect(function()
local anim = game.Players.LocalPlayer.Character.Humanoid:LoadAnimation(script.Parent.Animation)
anim:Play()
end)
end)
script.Parent.Unequipped:Connect(function()
local anim = game.Players.LocalPlayer.Character.Humanoid:LoadAnimation(script.Parent.Animation)
anim:Stop()
end)