Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Stamina/Hunger/Thirst bar? just don't know how to do the size

Here is the script so far

while script.Value.Value > 0 do
	wait(.1)
	script.Value.Value = script.Value.Value - 1
	val = script.Value.Value
end

script.Value.Changed:connect(function(change)
	script.Parent.Size = UDim2.new(0, val, 0, 25)
end)
  • Just a test script

2 answers

✓ Accepted answer

So if I am thinking correctly about what you are doing, I believe you want the gui to shrink with the hunger and such? So if it's at 50% the bar will be at 50% also? If so here is how I would do it.

The gui is just a frame in a screengui, it just acts as a sort of background for the meter.

local gui=script.Parent
local bar=script.Parent.bar
local value= script.Parent.Value
while true do
	wait()
	bar.Size=UDim2.new(value.Value *0.01, 0, 1, 0)--makes it the size in percent of the number the hunger is at, it makes the height the same as 'gui'.
end

1 comment

0

Thanks, but I already got it haha

I'm afraid I don't understand what's the problem here. Could you explain in a bit more detail?

This discussion is preserved as it was. New answers, comments, and votes are closed.