Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by
hudzell 238 Moderation Voter
10 years ago

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

Log in to vote
1
Answered by
ultrabug 306 Moderation Voter
10 years ago

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
0
Thanks, but I already got it haha hudzell 238 — 10y
Ad
Log in to vote
-1
Answered by 10 years ago

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

Answer this question