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

health system wont work can i have help?

I want to make a health system that goes up by 50 every time you level up how would I do this?

game.Players.PlayerAdded:Connect(function(player)
script.Parent.Humanoid.MaxHealth = 50 * player:WaitForChild('Stats').Level.Value  -- this is max health
	script.Parent.Humanoid.Health = 10 * player:WaitForChild('Stats').Level.Value

1 answer

Maybe try getting the old level, and using something in the lines of:

oldLevel = level

level.Changed:Connect(function()
	if oldLevel < level then
		humanoid.MaxHealth = humanoid.MaxHealth + 50
	end
end)

Do something like this to check if the old level was lower than the new one, and if so it will add 50 MaxHealth to the humanoid.

I hope this is what you were looking for!

1 comment

0

nah didnt work :/

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