Project 566: Custom Health Bar

11. (Optional) Turn off the default GUI

You can still see the default health bar. These lines of code will remove the default health bar. They will also remove the screen flashing effect Roblox gives when you take damage. 
Starting point file for this challenge

Your goal

Steps

1. Make a local variable called “StarterGUI” at the top of your code

This will eventually reference the starter, or default GUI that Roblox gives the player.

local StarterGui

2. Set the StarterGui variable to Roblox's StarterGui service

The StarterGUI is a service Roblox has.
game:GetService("StarterGui")

3. Call the SetGUIEnabled function on the “StarterGUI” variable

This is a simple function Roblox has that is used to turn parts of the default GUI on and off.
StarterGui:SetCoreGuiEnabled()

4. Fill out the parameters of the SetGUIEnabled function

It takes two parameters: which part of the GUI to turn on or off, and whether that GUI should be on or off. 

You can reference the default health bar with this line: 

Enum.CoreGuiType.Health

True will mean on, false will mean off. 

StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Health, false)