player = script.Parent.Parent.Parent.Parent.Parent.Parent
hum = player.Character.Humanoid
while wait() do
	script.Parent.Text = math.floor(hum.Health + .5)..'/'..player.Character.Humanoid.MaxHealth
	script.Parent.Parent.Size = UDim2.new(0,tonumber(math.floor(hum.Health * 3 + .5)),0,25)
	if script.Parent.Parent.Size > UDim2.new(0,300,0,225) then
		
	end
end

this script makes a nice working health bar. here's the explorer:

StarterGui

ScreenGui

	Frame

		health

			TextLabel     <--- to display the health

				LocalScript

I can't figure out what to put after the if statement, i want to be able to make the players maxhealth anything i want, and when i do that, the health gui gets bigger as the health comes. at 100, it fits perfectly on the screen, right where i want it to be. but if it was 110, the gui would be too big, and pop off the frame, and if my health got big enough, it would cover the bottom of the screen

2 comments

0

Your gui is endlessly expanding because your loop is never ending. Try a different loop perhaps? https://www.google.com/search?q=robloc+loops&ie=&oe=

0

edited question, i wasnt very clear