Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

[Solved]How do i change MaxHealth Value ?

Hello everyon,

Is it possible that the MaxHealth value is 8100 ?

I know how to change the Health and MaxHealth but my MaxHealth stucks at 8100 Health

i just have this to update MaxHealth value

while wait() do
	wait(1)
	local plr = script.Parent.Parent
	if plr then
		plr.Character.Humanoid.MaxHealth = 100+plr:WaitForChild("leaderstats"):WaitForChild("Power").Value
	end
end

and i don't know why but stucks on 8100

1 comment

0

MaxHealth actually can be infinity. I don't know why your MaxHealth is stuck at 8100, so can you give us more imformation please.

2 answers

✓ Accepted answer
local char
game.Players.PlayerAdded:Connect(function(plr)
    char = workspace:FindFirstChild(plr.Name)
    char.Humanoid.MaxHealth = char.Humanaoid.MaxHealth + plr:WaitForChild("leaderstats"):WaitForChild("Power").Value
    char.Humanoid.Health = char.Humanaoid.Health + plr:WaitForChild("leaderstats"):WaitForChild("Power").Value
end)
char.Humanoid.Died:Connect(function()
    char.Humanoid.MaxHealth = char.Humanaoid.MaxHealth + plr:WaitForChild("leaderstats"):WaitForChild("Power").Value
    char.Humanoid.Health = char.Humanaoid.Health + plr:WaitForChild("leaderstats"):WaitForChild("Power").Value
end)

This should make it so that when a player joins or does their health is set to 8100. You can change the number of health to whatever you desire.

All the best,

PrismaticFruits

iI's ok i found the Solution.

First of all i am so stupid :D i have a DNA system and my max power was currently 8000 xD thats why 8100 was the limit.

and i had 2 scripts working with the MaxHealth i just made it liek t his now

	Power.Changed:connect(function() 
		if Power.Value > PlayerDNA then
			Humanoid.MaxHealth = PlayerDNA+100
		else
			Humanoid.MaxHealth = Power.Value+100
		end
	end)

Works fine now and i don't need a loop :)

This discussion is preserved as it was. New answers, comments, and votes are closed.