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)

3 comments

0

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?

0

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)

0

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)