I'm looking to save the current value of a target's health as a variable, but I don't want that variable to update as his health regenerates or changes. I'm still pretty new to scripting, but is there any way I can save a targets health as a static number that will not change?
COMMUNITY QUESTION
Return and save the number of a humanoid's health property?
1 answer
Yes, here is an example :
local Humanoid = Target:WaitForChild("Humanoid") -- Target being the model that the humanoid is located in
local HealthVariable
Humanoid.HealthChanged:Connect(function(currentHealth)
HealthVariable = currentHealth
end)
and if you want to have it saved forever I recommend looking into DataStore
This discussion is preserved as it was. New answers, comments, and votes are closed.

2 comments
local Health = Humanoid.Health, variables don't update on their own.
^