#Health Regen zone

7 messages · Page 1 of 1 (latest)

storm latch
#

Can someone help me to create a health regen zone? I tried this comand:
`local area = script.Parent
local pisando = false

area.Touched:Connect(function(hit)
wait(2)
local humanoid = hit.Parent:FindFirstChild('Humanoid')

if humanoid and pisando == false then 
    pisando = true 
    repeat
        
        humanoid.Health = humanoid.Health + 10 
        wait(1)
        pisando = false
    until false 
    
end

end)`

but it has a lot of bugs like, it keeps healing u even when u are not in the zone

hasty bronze
#

No es un bug

#

Tontin

#

Ok

#

Para la solución que te propongo te doy, vas a necesitar 2 scripts y una variable por jugador

#

El primer script será de que cuando pise la zona cambiará la variable del jugador a true y cuando lo deje de pisar(part.untouched) cambiará la variable a false

#

Y el segundo script estará dentro del jugador y será un ciclo while true do que revise si la variable está en true para curarle cada cierto tiempo