Health doesnt start from 100

the stages of how its happening:

its a Titan Zombie which meanAbos
thats why i only had 1 hbar
- server clone The zombie

local zmb = game.Serverstorage.Zombie:clone()
zmb.parent = workspace

- Zombie HBar form as Screengui
retrieve health and maxhealth data from the New cloned Zombie to workspace.

local Character = game.Workspace.Zombie:WaitForChild("R6")
local hum = Character:WaitForChild("Humanoid") -- player humanoid
HpText.Text = string.format("Health: %s/%s", hum.Health, hum.MaxHealth) -- The hp TextLabel

hum.HealthChanged:Connect(function() -- function whenever player hp is changed
	local hp, maxhp = hum.Health, hum.MaxHealth
	if hp < 0 then
		hp = 0
	end
	HpText.Text = string.format("Health: %s/%s", math.round(hp), math.round(maxhp)) -- The hp TextLabel

:blush:
Problems:
when Player damage zombie as much as 50/100
and Server :destroy all zombies, when time runs out

the healthbar does not focus on the maxhealth and health (100/100) of the new zombieBos titan,
instead it focuses on the old zombie health data (50/100).

how do i make the titan zombie healthbar focus on the new cloned Zombie server?

You are pretty much focusing on just one zombie. Put this script inside every zombie being cloned to the workspace and just reference Character with Character = script.Parent:WaitForChild('R6')

its a Titan Zombie so itsabos, thats why i just put 1 hbar

I will try and deduce some stuff here:
You have an individual healthbar for the titan and you are not using the same healthbar for every zombie right? If so then probably change the name of the Titan Zombie to something other than zombie so the script doesn’t get confused with the other zombies

the point is when the titan zombie is cloned by the server and the player damaging it to 50/100,

but when the time runs out, the titan zombie will destroy no matter how much player damage,
so when the server clones a new titan zombie hbar will show the health of the new titan zombie, not the one that has been damaged by the player.

Idk man this is the only problem I see if the healthbar doesn’t change to the titan zombie’s health.

1 Like