Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do you temporarily stop regen Health when damaged?

Asked by 2 years ago

all answers are appreciated

1 answer

Log in to vote
0
Answered by
VAnkata20 135
2 years ago
Edited 2 years ago

I looked at your question and got interested myself and I made the code for that. here it is

01local Character = script.Parent
02local Humanoid = Character:WaitForChild("Humanoid")
03local CurrentHealth = Humanoid.Health
04local HealthScript = Character:FindFirstChild("Health")
05 
06Humanoid.HealthChanged:Connect(function(health)
07    if CurrentHealth > health then
08        HealthScript.Disabled = true
09        wait(3)
10        HealthScript.Disabled = false
11    end
12CurrentHealth = health
13end)

Put it in StarterCharacterScripts and you done . now the player needs to wait 3 seconds before healing appears

0
Thank you! Torekalanae 2 — 2y
0
no problem :) VAnkata20 135 — 2y
Ad

Answer this question