Attempt to index boolean with 'Play'

I don’t understand… with a simple command on animation

animation:Play()

I get this error:
01:26:27.041 - Players.nuttela_for1me.Backpack.LocalScript:29: attempt to index boolean with ‘Play’
animation still gets played, but I just don’t like the errors in my output.

Could you show more of the script?

local a4 = Instance.new("Animation", game.Workspace)
a4.AnimationId = "rbxassetid://5857108705" 
local reload = plr.Character.Humanoid:LoadAnimation(a4)

if input.KeyCode == Enum.KeyCode.R then
			if debounce == false and shots ~= 0 then
				currentTime = tick()
				debounce = true
				special = true
				shoot:Stop()
				idle:Stop()
				pick:Stop()
				reload:Play()
				reload.Stopped:Connect(function()
					reload = false
					special = false
					idle:Play()
				end)
			end
		end
1 Like

Strange. Could you send the full script that is inside StarterPack.LocalScript?

Ow forgot to mention, that appears to happen on reload animation

1 Like

We are talking about 335 lines of code :confused:

1 Like

That’s alright. Could you send maybe the first 50 or so?

Oh hold on,

Try making a new value for reload, you’re overriding the original variable (an animation) with a boolean.

hah I see I ment to write debounce instead of reload :smile:

1 Like