I am creating a admin thing and I want the admins to be able to regen when there heath changes.
✓ ANSWER ACCEPTED
How do i detect when a players health cahnges then heal them?
2 answers
✓ Accepted answer
There is a .Changed event. You would use it like so:
function changed()
player.Humanoid.Health = 100
end
instance.Changed:Connect(changed)
2 comments
0
Just read the comment, if theres a HealthChanged event then you would replace .Changed with it.
0
The reason there is a HealthChanged event is because it includes the new Humanoid's health as a parameter, also, that script will change your health if ANYTHING changes in the Humanoid, which is incorrect..
You will use the 'HealthChanged' function as stated above. If for some reason you have the health higher than 100, this will set it to the maxhealth
game:GetService("Players").PlayerAdded:Connect(function(plr)
plr.CharacterAdded:Connect(function(char)
local Humanoid = char:FindFirstChildOfClass("Humanoid")
Humanoid.HealthChanged:Connect(function()
Humanoid.Health = Humanoid.MaxHealth
end)
end)
end)
This discussion is preserved as it was. New answers, comments, and votes are closed.

2 comments
Listen to an event named HealthChanged. It is a part of Humanoid. The first parameter is the new value of the Humanoid's health.
https://scriptinghelpers.org/help/how-post-good-questions-answers ..