|
| 11 Feb 2013 05:48 PM |
PLEASE DO NOT SKIM, OR YOU MAY NOT KNOW HOW TO HELP ME
Okay, I would just give you the whole Script but it's really long, and I can't just give you the one line that broke it, so I'll give you a few surrounding lines.
This is for a custom health bar:
function onHealthChanged() if Humanoid.Health ~= 0 then local NS = Humanoid.Health * 2.5 S = UDim2.new(0,tonumber(NS),0,27) end end
Humanoid.HealthChanged:connect(onHealthChanged)
The line that broke the Script, was line four:
S = UDim2.new(0,tonumber(NS),0,27)
Just so you know. on line 2, I have variables leading up to the Humanoid, so that's not the problem. Also, S, is the Size Property of an ImageButton.
ALSO, no Output.
|
|
|
| Report Abuse |
|
|
|
| 11 Feb 2013 05:54 PM |
| What should happen but doesnt? |
|
|
| Report Abuse |
|
|
|
| 11 Feb 2013 05:56 PM |
| Well, this is for a health bar, the health bar should resize by shrinking slightly to the middle, but sadly it doesn't, and *Sigh* no Output. |
|
|
| Report Abuse |
|
|
|
| 11 Feb 2013 05:56 PM |
| just saying you don't need "tonumber()" there... |
|
|
| Report Abuse |
|
|
|
| 11 Feb 2013 05:56 PM |
| Well, you should use (health/maxhealth, 0, sizescale, sizeoffset) |
|
|
| Report Abuse |
|
|
|
| 12 Feb 2013 07:06 AM |
I don't know how that would help, since I only need to re-size the second argument. Remember, the health bar is TWO AND A HALF times longer in pixels (250) then your health (100)!
Anyone else have any ideas? |
|
|
| Report Abuse |
|
|
| |
|
|
| 12 Feb 2013 08:19 AM |
You could always do it by the:
AmountOfHealth/TotalHealth x 100
Gets the percentage. |
|
|
| Report Abuse |
|
|