Hello, I have an issue with my sword script where every time i try to detect for a hitbox it will just say attempt to index nil with ‘Name’
Players.ozifawaz3050.Backpack.Bamboo Sword.Script:25: attempt to index nil with ‘Name’
Heres some code.
local user = script.Parent.Parent.Name
hitbox.Touched:Connect(function(obj)
if obj.Parent.Name == user then
--nocodehere
else
if obj.Parent:FindFirstChild("Humanoid") then
obj.Parent.Humanoid:TakeDamage(2.5)
script.SwordHit:Play()
hitbox:Destroy()
end
end
end)
end)