Tripane
|
  |
| Joined: 03 Jun 2011 |
| Total Posts: 11432 |
|
|
| 17 Sep 2014 04:11 PM |
local Bar = script.Parent.Color local Player = game.Players.LocalPlayer Bar.Size = UDim2.new(Bar.Size.X.Scale, Player.Character.Humanoid.Health, Bar.Size.Y.Scale, Bar.Size.Y.Offset)
No output.
When the humanoid's health changes, the X offset does not change to the corresponding size |
|
|
| Report Abuse |
|
|
darthpyro
|
  |
| Joined: 18 Aug 2009 |
| Total Posts: 3569 |
|
|
| 17 Sep 2014 04:13 PM |
| Run a function to update the size every time the humanoid's health changes. |
|
|
| Report Abuse |
|
|
Tripane
|
  |
| Joined: 03 Jun 2011 |
| Total Posts: 11432 |
|
|
| 17 Sep 2014 04:23 PM |
local Bar = script.Parent.Color local Player = game.Players.LocalPlayer Player.Character.Humanoid.Health.Changed:connect(function() Bar.Size = UDim2.new(Bar.Size.X.Scale, Player.Character.Humanoid.Health, Bar.Size.Y.Scale, Bar.Size.Y.Offset) end)
Says I'm attepting to index health, a number value |
|
|
| Report Abuse |
|
|
Tripane
|
  |
| Joined: 03 Jun 2011 |
| Total Posts: 11432 |
|
| |
|
Tripane
|
  |
| Joined: 03 Jun 2011 |
| Total Posts: 11432 |
|
| |
|
|
| 17 Sep 2014 05:06 PM |
Try this:
local Bar = script.Parent.Color local Player = game.Players.LocalPlayer Player.Character.Humanoid.Changed:connect(function(property) if property == "Health" then Bar.Size = UDim2.new(Bar.Size.X.Scale, Player.Character.Humanoid.Health, Bar.Size.Y.Scale, Bar.Size.Y.Offset) end end) |
|
|
| Report Abuse |
|
|