I made a script for my custom health bar to make my player invincible for 3 seconds... didn't work, no output errors. Anyone know whats wrong? script:
local Plr = game.Players.LocalPlayer
local Char = Plr.Character
script.Parent.Changed:connect(function(val)
if script.Parent.Value >0 then
local Health = script.Parent.Value
for index, child in pairs(Char:GetChildren()) do
if child:IsA("Part") then
while wait(3) do
if val ~= Health then
script.Parent.Value = Health
child.Transparency = 0
wait(0.35)
child.Transparency = 1
elseif val == Health then
child.Transparency = 0
wait(0.35)
child.Transparency = 1
wait() -- anti freeze
end
end
chilf.Transparency = 1
end
end
end
end)

1 comment
Invisible or Invincible?