Ad
Log in to vote
0

How do you temporarily stop regen Health when damaged?

Asked by 17 days ago

all answers are appreciated

1 answer

Log in to vote
0
Answered by 17 days ago
Edited 17 days ago

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

local Character = script.Parent
local Humanoid = Character:WaitForChild("Humanoid")
local CurrentHealth = Humanoid.Health
local HealthScript = Character:FindFirstChild("Health")

Humanoid.HealthChanged:Connect(function(health)
    if CurrentHealth > health then
        HealthScript.Disabled = true
        wait(3) 
        HealthScript.Disabled = false
    end
CurrentHealth = health
end)

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

0
Thank you! Torekalanae 2 — 17d
0
no problem :) VAnkata20 49 — 17d
Ad

Answer this question