#Need Help
7 messages · Page 1 of 1 (latest)
** You are now Level 1! **
k
a=5-- times u have to hit him before he dies
while wait() do
wait()
if script.Parent.Health < script.Parent.MaxHealth then
a=a-1
if a < 2 then
script.Parent.Health = script.Parent.Health - script.Parent.Health
break
else
script.Parent.Health = script.Parent.MaxHealth
end
end
end
Here it is
Try it
a = 5 -- number of times the character can be hit before it dies
stamina = 5 -- initial value for the stamina bar
while wait() do
wait()
if script.Parent.Health < script.Parent.MaxHealth then
a = a - 1
stamina = stamina - 1
if a < 2 then
script.Parent.Health = script.Parent.Health - script.Parent.Health
break
else
script.Parent.Health = script.Parent.MaxHealth
end
-- update the value of the stamina bar
script.Parent.Stamina.Value = stamina
end
end