here's the code.
local sound = game.Workspace.soundplayer.sound3
function onTouched(hit)
local h = hit.Parent:findFirstChild("Humanoid")
if h.health >= 100 then
local h = hit.Parent:findFirstChild("Humanoid")
print("Max Health!")
end
if h.Health < 100 then
local h = hit.Parent:findFirstChild("Humanoid")
h.Health = h.Health + 1
sound:Play()
script.Parent:Destroy()
end
if h.Health >=80 then
local h = hit.Parent:findFirstChild("Humanoid")
h.Health = 100
sound:Play()
script.Parent:Destroy()
end
end
script.Parent.Touched:connect(onTouched)

2 comments
.
.