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: Moving gui based on a value?

Previous Thread :: Next Thread 
crash9000000 is not online. crash9000000
Joined: 12 Sep 2009
Total Posts: 194
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 is not online. 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
crash9000000 is not online. crash9000000
Joined: 12 Sep 2009
Total Posts: 194
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
crash9000000 is not online. crash9000000
Joined: 12 Sep 2009
Total Posts: 194
03 Mar 2015 03:25 PM
Bump
Report Abuse
AnimeWiki is not online. 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
crash9000000 is not online. crash9000000
Joined: 12 Sep 2009
Total Posts: 194
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
crash9000000 is not online. crash9000000
Joined: 12 Sep 2009
Total Posts: 194
03 Mar 2015 06:22 PM
bump
Report Abuse
AnimeWiki is not online. AnimeWiki
Joined: 26 Oct 2014
Total Posts: 460
04 Mar 2015 02:09 PM
It should be at startergui.
Report Abuse
crash9000000 is not online. crash9000000
Joined: 12 Sep 2009
Total Posts: 194
04 Mar 2015 03:07 PM
Quite obviously the health GUI is in the StarterGUI.
Report Abuse
AnimeWiki is not online. 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
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