generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Health Gui

Previous Thread :: Next Thread 
micke3212 is not online. micke3212
Joined: 24 Nov 2009
Total Posts: 3000
20 Sep 2013 09:36 PM
g = script.Parent.Parent.Parent.Parent.Parent.Name
f = game.Workspace.g
while true do
b = script.Parent.map1
b.Size = "{0, "..f.Humanoid.Health.."{0, 20}"
b.Text = f.Humanoid.Health.."/"..f.Humanoid.MaxHealth
end

--Ok so basically I need help because i try to add this script to my frame and have a TextBox inside the frame and a local script. Please fix this! I want it to state the Health and I want it to show the health of size. Just going to tell ya, I make the b.Size = 100 since the humanoid health is 100 max.
Report Abuse
Xtreme101 is not online. Xtreme101
Joined: 03 Jan 2009
Total Posts: 4385
20 Sep 2013 09:38 PM
Did you make this yourself, or receive it from something else?
Report Abuse
micke3212 is not online. micke3212
Joined: 24 Nov 2009
Total Posts: 3000
20 Sep 2013 09:40 PM
I made the Gui myself, it has a local script were it removes the other gui's that you get and it is suppose to match the Health of your humanoid in the workspace.
Report Abuse
micke3212 is not online. micke3212
Joined: 24 Nov 2009
Total Posts: 3000
20 Sep 2013 09:41 PM
Yes i did make the script,gui, and the other local script...
Report Abuse
Xtreme101 is not online. Xtreme101
Joined: 03 Jan 2009
Total Posts: 4385
20 Sep 2013 09:44 PM
To set a gui's size and/or position:

UDim2.new(xscale, xoffset, yscale, yoffset)
Report Abuse
micke3212 is not online. micke3212
Joined: 24 Nov 2009
Total Posts: 3000
20 Sep 2013 09:47 PM
So basically I need to make a variable for instance
b = f.Humanoid.Health
c = f.Humanoid.MaxHealth
d = g.map1
script.Parent.map1:UDim2.new(b,0,20,0)
Report Abuse
Mordeaux is not online. Mordeaux
Joined: 31 Oct 2012
Total Posts: 106
20 Sep 2013 09:56 PM
You shouldn't have given Waffles9321 that 3 AP for holding still.

And the script has to have some idea of the scale of your GUI, otherwise it won't know to change anything.
Report Abuse
micke3212 is not online. micke3212
Joined: 24 Nov 2009
Total Posts: 3000
20 Sep 2013 10:10 PM
Ok so heres were I am so far tell me what I need to do next...
playr = script.Parent.Parent.Parent.Parent.Parent.Name
f = game.Workspace.playr
d = f.Humanoid.Health
while true do
wait(0.01)
local b = script.Parent.map1
b.Size = UDim2.new(0, d, 0, 20)
b.Text = f.Humanoid.Health.."/"..f.Humanoid.MaxHealth
end
Report Abuse
Mordeaux is not online. Mordeaux
Joined: 31 Oct 2012
Total Posts: 106
20 Sep 2013 10:14 PM
For that kind of script, use a wait() instead of a wait(0.01). wait() waits the least amount of time possible without breaking the game.
Report Abuse
micke3212 is not online. micke3212
Joined: 24 Nov 2009
Total Posts: 3000
20 Sep 2013 10:14 PM
playr = script.Parent.Parent.Parent.Parent.Parent.Name
f = game.Workspace.playr
d = f.Humanoid.Health
while true do
wait(0.01)
local b = script.Parent
b.Size = UDim2.new(0, d, 0, 20)
b.Text = f.Humanoid.Health.."/"..f.Humanoid.MaxHealth
end
Fixed some bugs and know i'm this far... Please help! I have it while true do because i want to update quickly, also I want it to be the Health Gui...
Report Abuse
micke3212 is not online. micke3212
Joined: 24 Nov 2009
Total Posts: 3000
20 Sep 2013 10:18 PM
Ok so I added that! It's still not working please help.
Report Abuse
Xtreme101 is not online. Xtreme101
Joined: 03 Jan 2009
Total Posts: 4385
20 Sep 2013 10:20 PM
New output?
Report Abuse
micke3212 is not online. micke3212
Joined: 24 Nov 2009
Total Posts: 3000
20 Sep 2013 10:27 PM
11:27:29.982 - playr is not a valid member of Workspace
11:27:29.984 - Script 'Players.micke3212.PlayerGui.Health.tray.map1.Script', Line 2
11:27:29.984 - stack end
11:27:29.984 - HealthGUI is not a valid member of PlayerGui
11:27:29.985 - Script 'Players.micke3212.PlayerGui.Health.LocalScript', Line 4
11:27:29.985 - stack end
Report Abuse
micke3212 is not online. micke3212
Joined: 24 Nov 2009
Total Posts: 3000
20 Sep 2013 10:28 PM
playr = script.Parent.Parent.Parent.Parent.Parent.Name
f = game.Workspace.playr
d = f.Humanoid.Health
while true do
wait()
local b = script.Parent
b.Size = UDim2.new(0, d, 0, 20)
b.Text = f.Humanoid.Health.."/"..f.Humanoid.MaxHealth
end

--Thats the new script so far...
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image