|
| 21 Jun 2015 01:35 AM |
| I also need to know how to put it into food. |
|
|
| Report Abuse |
|
|
|
| 21 Jun 2015 01:37 AM |
| Also, I will do this myself. |
|
|
| Report Abuse |
|
|
|
| 21 Jun 2015 02:18 AM |
In order to do a hunger and thirst GUI first you need a Frame to contain a image, and in the same frame a text label. You could make the text update to be the percentage but that is obviously up to you.
- Frame -- Image -- Text
Anyways, basically you will be making a MaxHunger, MaxThirst, Thirst, and Hunger variable.
So for example:
MaxHunger = 100 Hunger = MaxHunger <-- You will want to load this probably on start up so you will just update the hunger.
You will need a constant loop, such as a while loop.
while Hunger ~= 0 and Thist ~= 0 then wait(1)
And within this, you will want to update the variable by negating it.
Hunger = Hunger - 1
Then you will change your images size, which will be the your Y axis.
MyUI.Size = UDim2.new(0,1,0, (Hunger / MaxHunger))
That should be the math forumula to get the percentage of your Hunger and Thirst. Current divided by Max (100). You may need to play around with the size. I don't use ROBLOX anymore, I use Unreal Engine 4 and I have this, and made it on ROBLOX before.
Hope this helps, cheers. |
|
|
| Report Abuse |
|
|
| |
|
|
| 21 Jun 2015 02:35 AM |
| I'd like to know how to use that with food and drinks so I can replenish my hunger/thirst. |
|
|
| Report Abuse |
|
|
daireb
|
  |
| Joined: 16 Nov 2012 |
| Total Posts: 726 |
|
|
| 21 Jun 2015 03:05 AM |
U even script bro?
The solution is called addition |
|
|
| Report Abuse |
|
|
ssd21345
|
  |
| Joined: 28 Jan 2009 |
| Total Posts: 5985 |
|
| |
|
|
| 21 Jun 2015 10:55 AM |
I'd appreciate it if you could of told me thanks, or something to let me know I helped you. Like everyone else is saying, it's called addition but I'm not going to be specific with it.
Look up a tutorial or script someone has already and learn from how to use it maybe. |
|
|
| Report Abuse |
|
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
|
| 21 Jun 2015 10:57 AM |
TweenSize.
http://wiki.roblox.com/index.php?title=API:Class/GuiObject/TweenPosition |
|
|
| Report Abuse |
|
|