Sign in
Home
Online Classes
Instructors
Tutorials
☰
Register
Sign in
Online Classes
Instructors
Tutorials
1. Open Roblox studio and load the starter kit
2. Test it out
3. Group Activity: Parent and Child Sizes
4. Create a health bar container
5. Create the health bar
6. Create a local script
7. Access the player and health bar UI
8. Write a function to update the health bar
9. Test and adjust
10. Polishing the health bar effect
11. (Optional) Turn off the default GUI
12. (Optional) Push the visual design
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
Hint: show steps
Steps
1. Make a local variable called “StarterGUI” at the top of your code
Hint: show details
This will eventually reference the starter, or default GUI that Roblox gives the player.
local StarterGui
Hint: show image
Hint: show code
2. Set the StarterGui variable to Roblox's StarterGui service
Hint: show details
The StarterGUI is a service Roblox has.
game:GetService("StarterGui")
Hint: show image
Hint: show code
3. Call the SetGUIEnabled function on the “StarterGUI” variable
Hint: show details
This is a simple function Roblox has that is used to turn parts of the default GUI on and off.
StarterGui:SetCoreGuiEnabled()
Hint: show image
Hint: show code
4. Fill out the parameters of the SetGUIEnabled function
Hint: show details
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)
Hint: show image
Hint: show code
×
×
Provide your email address for immediate project access
Email
Check your email for instructions on how to create a full DA account