I cant just wrap my head around this one. I feel like its super easy but it just never works. The error report is "Humanoid is not a valid member of Backpack". Can anyone help me fix this, I've been trying for hours.
local CanAttack = true
local player = game.Players.LocalPlayer
local char = player.Character
script.Parent.Equipped:Connect(function()
local idle = script.Parent.Parent.Humanoid:LoadAnimation(script.Idle)
local attack = script.Parent.Parent.Humanoid:LoadAnimation(script.Attack)
idle:Play()
end)
script.Parent.Activated:Connect(function()
print("Rope Activated")
local idleAnimation = script.Idle
local attackAnimation = script.Attack
local idle = script.Parent.Parent.Humanoid:LoadAnimation(idleAnimation)
local attack = script.Parent.Parent.Humanoid:LoadAnimation(attackAnimation)
idle:Stop()
attack:Play()
print('Animation Playing')
wait(5)
idle:Play()
print('Animation Stopped')
end)
function onUnEquipped()
local idleAnimation = script.Idle
local idle = script.Parent.Parent.Humanoid:LoadAnimation(idleAnimation)
idle:Stop()
end
script.Parent.Unequipped:Connect(onUnEquipped)

1 comment
This is an action from a player holding a tool. Not a NPC in the workspace.