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 » Scripters
Home Search
 

Re: Not working properly...

Previous Thread :: Next Thread 
9draco is not online. 9draco
Joined: 13 Nov 2010
Total Posts: 5841
10 Dec 2015 03:23 AM
while not game.Players.LocalPlayer.Character do wait() end

while wait() do
local cur = game.Players.LocalPlayer.Character.Humanoid.Health
local max = game.Players.LocalPlayer.Character.Humanoid.MaxHealth
script.Parent.Size = UDim2.new(max / cur, 0, 1, 0)
end

It shows as if my health is 0, why is that?
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
10 Dec 2015 03:25 AM
cur/max
Report Abuse
9draco is not online. 9draco
Joined: 13 Nov 2010
Total Posts: 5841
10 Dec 2015 03:26 AM
Changed it, but still doesn't work.
Report Abuse
nofascistsaloudxD is not online. nofascistsaloudxD
Joined: 02 Sep 2015
Total Posts: 408
10 Dec 2015 03:26 AM
Why don't you just set the healths like this...


while wait() do
local cur = game.Players.LocalPlayer.Character.Humanoid.Health
local max = game.Players.LocalPlayer.Character.Humanoid.MaxHealth
cur = whatever(a number xD)
max = whatever(a number xD)
end

i am just a begginer scripter tho... so erm... idk, it might work? xD
Report Abuse
9draco is not online. 9draco
Joined: 13 Nov 2010
Total Posts: 5841
10 Dec 2015 03:27 AM
The script I shown resized GUIs to be synchronized with my actual health.
Report Abuse
nofascistsaloudxD is not online. nofascistsaloudxD
Joined: 02 Sep 2015
Total Posts: 408
10 Dec 2015 03:28 AM
OH. so you tryna make a health bar?
Report Abuse
9draco is not online. 9draco
Joined: 13 Nov 2010
Total Posts: 5841
10 Dec 2015 03:28 AM
Yup.
Report Abuse
nofascistsaloudxD is not online. nofascistsaloudxD
Joined: 02 Sep 2015
Total Posts: 408
10 Dec 2015 03:29 AM
Yeah... i started scripting a few weeks ago, i just know some of the basics :/
Report Abuse
nofascistsaloudxD is not online. nofascistsaloudxD
Joined: 02 Sep 2015
Total Posts: 408
10 Dec 2015 03:31 AM
OOH! also, i almost forget, i am so sorry but can you please check this out?

http://forum.roblox.com/Forum/ShowPost.aspx?PostID=179392564

thx if you can... thx if you can't :P
Report Abuse
9draco is not online. 9draco
Joined: 13 Nov 2010
Total Posts: 5841
10 Dec 2015 03:41 AM
is this output related to the error Im making?

httpGet http://assetgame.roblox.com/asset/?id=225328818 failed. Trying again. Error: CURL error (curl_easy_perform, 1713DBE0): Failure when receiving data from the peer. Elapsed time: 0.261155
Report Abuse
9draco is not online. 9draco
Joined: 13 Nov 2010
Total Posts: 5841
10 Dec 2015 03:47 AM
And the output has nothing to do with my error xD, but any solutions?
Report Abuse
9draco is not online. 9draco
Joined: 13 Nov 2010
Total Posts: 5841
10 Dec 2015 04:17 AM
Solved. Thx guys
Report Abuse
Alpinu is not online. Alpinu
Joined: 10 Jul 2010
Total Posts: 108
10 Dec 2015 04:18 AM
I do not believe that http thing is related. I seem to get that every time as well for no particular reason.

Anyway, your problem is quite simple and obvious, as you will realize in a second. Let me explain.

Let's say your MaxHealth is 100 (which it is, by default). If you have not taken any damage, your Health is also 100 (or whatever your MaxHealth is). Therefore, max / cur = 100 / 100 = 1. So, naturally, this is going to look like your health is 0.
Report Abuse
Alpinu is not online. Alpinu
Joined: 10 Jul 2010
Total Posts: 108
10 Dec 2015 04:18 AM
Oops! Your post wasn't there saying you solved it before I replied, I swear! Haha. Congrats though. :)
Report Abuse
9draco is not online. 9draco
Joined: 13 Nov 2010
Total Posts: 5841
10 Dec 2015 04:45 AM
Yeah, I switched it to cur/max, but it wasn't working, but I solved it.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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