|
| 02 Mar 2015 12:04 AM |
I have a health bar gui that I rigged up and I want to have it simply pan to the left whenever the a value loses 10 .
PHP = game.Players.LocalPlayers.CharStats.Health
if PHP.Value == PHP.Value - 10 then game.Players.LocalPlayer.PlayerGui.HpGui.DmgFrame.Position = game.Players.LocalPlayer.PlayerGui.DmgFrame.Position+UDim2.new(0, 0, 20) end
This script is inside of the "DmgFrame" thanks in advance for any help. |
|
|
| Report Abuse |
|
|
T00NAMI
|
  |
| Joined: 10 Mar 2013 |
| Total Posts: 211 |
|
|
| 02 Mar 2015 05:25 AM |
try this:
local Player = game.Players.LocalPlayer local Health = Player.CharStats.Health
if Health.Value == Health.Value - 10 then local dmgFrame = Player.PlayerGui.HpGui.DmgFrame if dmgFrame ~= nil then dmgFrame.Position = dmgFrame.Position + UDim2.new(0, 0, 0, 20) end end |
|
|
| Report Abuse |
|
|
|
| 02 Mar 2015 06:43 PM |
| I tried placing this in a script and a local script. The output has nothing to say, but the frame wont move. |
|
|
| Report Abuse |
|
|
| |
|
AnimeWiki
|
  |
| Joined: 26 Oct 2014 |
| Total Posts: 460 |
|
|
| 03 Mar 2015 03:26 PM |
http://www.roblox.com/Mana-gui-item?id=162922573
|
|
|
| Report Abuse |
|
|
|
| 03 Mar 2015 04:47 PM |
I took the item and checked out the script inside. I wrote it to look like this :
wait() frame = script.Parent p = script.Parent.Parent.Parent.Parent.Parent ch = game.Workspace[p.Name] Hp = p.CharStars.Health if Hp.Value == Hp.Value - 10
then while true do frame.Size = UDim2.new((p.Hungry.Value / p.MaxHungry.Value), 0, 1, 0) wait()
end end
But AGAIN the output says nothing. |
|
|
| Report Abuse |
|
|
| |
|
AnimeWiki
|
  |
| Joined: 26 Oct 2014 |
| Total Posts: 460 |
|
|
| 04 Mar 2015 02:09 PM |
| It should be at startergui. |
|
|
| Report Abuse |
|
|
|
| 04 Mar 2015 03:07 PM |
| Quite obviously the health GUI is in the StarterGUI. |
|
|
| Report Abuse |
|
|
AnimeWiki
|
  |
| Joined: 26 Oct 2014 |
| Total Posts: 460 |
|
|
| 05 Mar 2015 10:13 AM |
http://www.roblox.com/Health-bar-item?id=223291480
there rescripted. |
|
|
| Report Abuse |
|
|