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
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
| |
|
9draco
|
  |
| Joined: 13 Nov 2010 |
| Total Posts: 5841 |
|
|
| 10 Dec 2015 03:26 AM |
| Changed it, but still doesn't work. |
|
|
| Report Abuse |
|
|
|
| 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
|
  |
| 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 |
|
|
|
| 10 Dec 2015 03:28 AM |
| OH. so you tryna make a health bar? |
|
|
| Report Abuse |
|
|
9draco
|
  |
| Joined: 13 Nov 2010 |
| Total Posts: 5841 |
|
| |
|
|
| 10 Dec 2015 03:29 AM |
| Yeah... i started scripting a few weeks ago, i just know some of the basics :/ |
|
|
| Report Abuse |
|
|
|
| 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
|
  |
| 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
|
  |
| 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
|
  |
| Joined: 13 Nov 2010 |
| Total Posts: 5841 |
|
| |
|
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
|
  |
| 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
|
  |
| 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 |
|
|