The purpose is to have a health bar, a bit like Skyrim's where it gets closer to the middle, depending on health, but the second part will change its colour, i'm sure I went wrong in several places, none of it works, I could of gone wrong with (I have given the GUI a size and colour to begin with, in its actual properties). I'm fairly sure GUIs do not have brickcolors, but I don't know how to put the Red, Blue, Green properties in it.
It is meant to be unique for each player too. The script is in the Starter GUI, inside a Screen GUI, inside a Frame.
local Frame= script.Parent local health = script.Parent.Parent.Parent.Parent.Character.humanoid.Health.Value while true do wait(0.1) Frame.Size=Frame.Size.new{0, health},{0, 5} end while true do wait(0.05) if health==100>=75 then Frame.BackgroundColor3= Frame.BackgroundColor3.new ("Dark Green") end -- If your health is from 100 to 75 then make the bar, this color elseif health==74>=50 then Frame.BackgroundColor3= Frame.BackgroundColor3.new ("Grime") end elseif health==49>=25 then Frame.BackgroundColor3= Frame.BackgroundColor3.new ("Cool Yellow") end elseif health==24>=0 then Frame.BackgroundColor3= Frame.BackgroundColor3.new ("Bright Red") end end