local tool = script.Parent
local CanActivate = true
tool.Activated:connect(function()
local humanoid = tool.Parent:FindFirstChild("Humanoid")
local animation = script.Drink
local AnimationTrack = humanoid:LoadAnimation(animation)
if CanActivate == true then
CanActivate = false
AnimationTrack:Play()
wait(1)
humanoid.Health = humanoid.Health + 50
wait(10)
CanActivate = true
end
end)
COMMUNITY QUESTION
This script I have is adding and then removing health, why is it removing the health?
0 answers
No public answers were preserved for this question.
This discussion is preserved as it was. New answers, comments, and votes are closed.

3 comments
Is the script a localscript and is the tool restoring the health? For example, if I take 50 damage and apply the tool, the health goes back to 50 after 1 second?
i don’t know why it remove the health, but it seems like the remove health problem is from another script no this( maybe, i never try to add health to player when the player health is at max)
if this is a local script, the health change will only be client sided. when a server script looks at your health, it wont see the change and any changes it does will be relative to the original health which will then be replicated back to the client (effectively removing the change)