So I Edited part of a script from food, to make the hunger bar go up when you eat it.
It works, but I only found a way to make it so that it fills the hunger bar all the way.
So is there any way to add a certain amount to the UDim2 property of the Gui, and make it so it doesn't go above what it is normally?
This is the chunk of code where it adds full thirst
local character = Tool.Parent
local player = game.Players:GetPlayerFromCharacter( character )
local thirst = player.PlayerGui.Thirst
if (thirst ~= nil) then
thirst.BG.Bar.Size = UDim2.new(1, 0, 1, 0)

2 comments
I like the script, but It's hard to insert it into the other script, I usually have trouble where to put 'ends' and stuff
Just use the general idea to write your own. That's usually the best way to figure out how the code works is to rewrite it. Also you should have an end for every if, for, while, or function. Put ends at the end of the statement, kind of like a period.