Trying to make it where you touch it and your health is regenerated back to 100. And then it is transparent and non-cancollided for 10 seconds. While disabling the script for 10 seconds. I have been optimizing this script for awhile and I don't know what else to do.
local Part = script.Parent
function onTouch()
local Humanoid = Part.Parent:FindFirstChild("Humanoid")
if (Player ~= nil) then
Humanoid.Health = 100
end
end
Part.Touched:connect(onTouch)
function onTouch()
if (Player ~= nil) then
Part.Transparency = 0
Part.CanCollide = false
wait(10)
Part.Transparency = 1
Part.CanCollide = true
end
end
Part.Touched:connect(onTouch)
function onTouch()
if (Player ~= nil) then
script.Disabled = true
wait(10)
script.Disabled = false
end
end

1 comment
Didnt work...