Okay so I've made a damage script that when you touch a part you're losing 20 health.The bug isn't in the script but I want to make it so like that part damages the character only once. If I destroy the part it works but I don't intend to do it. Any suggestions?
x.Touched:connect(function(Part)
if Part.Parent:FindFirstChild("Humanoid") ~= nil and Part.Parent:FindFirstChild("Humanoid") ~= Player.Character.Humanoid and Part.Parent.Name ~= "Wall" then
Part.Parent.Humanoid.Health = Part.Parent.Humanoid.Health-20
end
end)

4 comments
This is in a Script right?
Yeah it's the damaging part of the script.
please post more code (like the x variable) and the error you get
I don't get any error..... It's just that it damages the character when it touches until he touches it no more.... If I destroy the part I prevent this but I don't want to... also if I put script.Disabled = true and after Script.Disabled = false it's annoying.