Reading through it seems that you add the part to the debris service in an if statement
1 | if Hit.Parent:findFirstChild( "Humanoid" ) and Hit.Parent.Humanoid ~ = player.Character.Humanoid |
3 | Hit.Parent.Humanoid:TakeDamage( |
5 | game.Debris:AddItem(x, 0.8 ) |
This means that if the IF function doesn't fire either due to a coding error or any other reason, the part is not added to the debris service and will not dissapear.
Try adding a print() before it to see if it's actually firing.
1 | if Hit.Parent:findFirstChild( "Humanoid" ) and Hit.Parent.Humanoid ~ = player.Character.Humanoid |
3 | Hit.Parent.Humanoid:TakeDamage( |
5 | game.Debris:AddItem(x, 0.8 ) |
7 | print ( "x added to debris." ) |
I also noticed that you're using Destroy() on the part before adding it to the debris service. If this doesn't throw an error then chances are the entire IF statement isn't firing at all.
Add a buttload of prints wherever there are issues, and get back to me if this solves none of them.
If all that fails then hait could be that this:
Completely stops the script from running. Try adding a print at the end, i.e.:
01 | Hit.Parent.Humanoid:TakeDamage( 90 ) |
03 | game.Debris:AddItem(x, 0.8 ) |
06 | script.Disabled = false |
08 | print ( "Ran successfully" ) |
If this doesn't print then your disabling the script stopped it from running the code as a whole.
If this is the case the use a debounce.
Otherwise