Here’s a thing that bites everyone: a Touched event fires way more often than you’d think. Brush a part for half a second and it can fire ten times, because your character is a bunch of parts and they keep grazing it. If you give a player a coin on every fire, they get ten coins from one touch. Not great.
The fix is a debounce, which is just a fancy name for a “busy” flag. You already used this in your obby, so this is a quick review of why it works.
local part = script.Parent
local debounce = false
local function onTouch(hit)
if debounce then return end
debounce = true
part.Color = Color3.fromRGB(255, 200, 0)
wait(1)
debounce = false
end
part.Touched:Connect(onTouch)
Trace the logic. First touch: debounce is false, so we skip the early return, flip it to true (now we’re busy), do the action, wait, then flip it back. Any touch during that wait hits if debounce then return end and bails out immediately. One clean action per touch, exactly what you wanted.
The return with nothing after it is the trick. It means “leave this function right now,” which is perfect for an early exit. Run the checklist and confirm your action fires once, not in a flood. When it behaves, mark it done.