This script I have is adding and then removing health, why is it removing the health?
Asked by
3 years ago Edited 3 years ago
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)