So basically I want to stop the health regeneration of a player when they touch Part A but only continue healing after touching Part B. I tried doing the opposite of the health script by removing a health point per second. However, they script only minus the health of a player like 5 times because I have not added a debounce yet cause I am afraid multiple players land on it at once and some would evade the stopping for health regeneration. I have tried looking devforum about this but only found posts regarding the delaying of health regeneration so far. Of course I am not asking you to write the entire script for me but tell me what I should use to achieve my goal
script.Parent.Touched:Connect(function(hit) local tb = 0 if hit and hit.Parent and hit.Parent:FindFirstChild("Humanoid") then tb = 1 while tb == 1 do hit.Parent.Humanoid.Health = hit.Parent.Humanoid.Health - 1 wait(1) if game.Workspace.NoRegenLand.RestartRegen and hit.Parent:FindFirstChild("Humanoid") then tb = 0 break end end end end)
So what types of script or function should I use?