How do I make each part can be touched once

So I want to make a script where each part when touched adds +1 to gui stat (by value) and it can only happen once per part.

The problem is that no matter if I make delay

local delay = true
if delay == true then
delay = false

when the parts are close to each other and the player touches them very quickly, sometimes one part adds more than +1
any ideas how to fix it?

(and by the way, I’m sorry that I showed this problem very badly, I’m just on my phone)

If you are wanting a part to only be touched once you can use :Once() like so:

	-- Wont fire again

Edit: Explanation - :Once() connects a function that is disconnected right after its fired. It can be used for functions that are only going to be used once.