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

how to fix this humanoid error? It occurs on line 11-12

Asked by
corbenv 17
5 years ago

So I made 2 scripts, and I keep getting the error "Humanoid is not a valid member of backpack." PipePullOut is an animation, and the pull out and attack animations work just fine, but the line that makes them stop has an error. I dont know what I did wrong. I am a beginner to scripting, so Im pretty clueless.!yeet

0
My budy boi. We need the script lol. kittonlover101 201 — 5y
0
We can't edit the script with an image. kittonlover101 201 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago
Edited 5 years ago

You have to use unequip in the same piece of code as the equip for it too work.

I had this exact same issue a while back!

Hope it helps.

local CanAttack = true

script.Parent.Equipped:Connect(function()
    local PipePullOut = script.Parent.Parent.Humanoid:LoadAnimation(script.PipePullOut)
    local PipeAttack = script.Parent.Parent.Humanoid:LoadAnimation(script.PipeAttack)
    PipePullOut:Play()
    script.Parent.Unequipped:connect(function(mouse) PipePullOut:Stop() end)
end)

If you need further help on this matter just ask.

0
It works! Thank you! corbenv 17 — 5y
0
I had the same issue a while back. It really sucked. You're welcome. kittonlover101 201 — 5y
Ad

Answer this question