I am doing a comboable health bar.I really need Help. Pls help

So, im working on a health bar. But if u hit the player continously, the health bar decrease but the white bar decrease after the combo is done (= stop hitting continously) (i tried for 2 days and now i have no idea how to make thisworking correctly) (sorry for my english)

local things here if ya want

In the explorer there is the health script and container1 which just work as healthbar.
health2 script and container2 is the combo health bar.

IN THE SCRIPT:

theres a ChangeHealth function which means make the bar decrease (or increase with player health)

	if humanoid.Health < oldhealth then
		...
	end
end) 

(check if player take damage (not changed health))

and the inside is the check if player get hit continously, wait until done then wait 1 sec then decrease

1 Like

Can you do

local Bar1 = (RedBar)
local Bar2 = (WhiteBar) --Bar at the back of Bar1 
--if you mean something like this then try

Humanoid.HealthChanged:Connect(function(Health) 
       Bar1.Size = UDim2.new(Health/Humanoid.MaxHealth,0,1,0)
       delay(1,function() 
               Bar2.Size = UDim2.new(Health/Humanoid.MaxHealth,0,1,0)
       end) 
end)
3 Likes

why are you using delay in 2022

task.delay(1,function()
end)
1 Like

sorry i don’t know what’s the driffent between task.delay and delay can you explan for me?

task.delay is just better newer version of delay
delay is really old and like not as good

2 Likes

Imma try, but i think it just delay after 1 hit, bot a combo, i have a solution is to make a combo system first, when combo-ed, combo.Values = true ig