Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

LoadAnimation:() suddenly has stopped working. Any answers?

Asked by 4 years ago

so i have this knife weapon im working on yet the attack animation just stopped working, it worked before but it suddenly just started giving this error message:

Players.munkuush.Backpack.Knife.Script:25: attempt to index boolean with 'Play'

I am confused, anyways, heres my code:

01local player = script.Parent.Parent.Parent
02local char = player.Character or player.CharacterAdded:Wait()
03local hum = char:WaitForChild("Humanoid")
04wait()
05local idle = hum:LoadAnimation(game.ReplicatedStorage.Knife_Idle)
06local attack = hum:LoadAnimation(game.ReplicatedStorage.Knife_Attack)
07local cooldown = false
08local attack = false
09 
10script.Parent.Equipped:Connect(function()
11    idle:Play()
12end)
13 
14 
15script.Parent.Unequipped:Connect(function()
View all 43 lines...

1 answer

Log in to vote
0
Answered by 4 years ago

Turns out im an idiot, i had 2 variables named 'attack'. Sorry for being dumb

Ad

Answer this question