I made a sword that consists of 2 scripts, the damage and the main script.This happens when I hit the dummy and then hit away from the dummy. This is the error I am getting: https://prnt.sc/s4wr1p
Here is the damage script
local db = false
script.Parent.Handle.Touched:Connect(
function(hit)
if db == false then
if hit.Parent.Humanoid then
db = true
hit.Parent.Humanoid:TakeDamage(10)
script.parent.blood.PlaybackSpeed = math.random(1.0, 1.2)
script.parent.blood:Play()
wait(.5)
db = false
script.Disabled = true
else
return
end
end
end
)

1 comment
It says humanoid is not a valid member of workspace. In either line 5 or 7, hit.Parent is referring to Workspace. If hit is the player/entity, maybe try hit:FindFirstChild("Humanoid") ?