irlkaleI
(Ninja)
August 20, 2023, 7:14pm
#1
You can write your topic however you want, but you need to answer these questions:
What do you want to achieve? A bar that sizes with a int value in a folder.
What is the issue? The bar just goes black. Even if the int value is above 0.
What solutions have you tried so far? Chatgpt, dev forums.
for _, player in ipairs(Players:GetPlayers()) do
local Bar = player.PlayerGui.GameInfo.Hunger
local Int = workspace.Values.Hunger
local Num = 1
while wait() do
Int.Value = Int.Value - Num
local IntSize = Int.Value
local Size = UDim2.new(0, IntSize, 0, 0)
Bar.Size = Size
print(Size)
end
end
Ninja:
while wait(3) do
Int.Value = Int.Value - Num
local IntSize = Int.Value
local Size = UDim2.new(0, IntSize, 0, 0)
Bar.Size = Size
print(Size)
end
end
Perhaps try waiting a few seconds before dropping a unit?
nayro007
(zaza)
August 20, 2023, 7:37pm
#3
Having no wait, in a loop, will end as an instantly loop. This means, there is no time between those actions, you may not forget " wait(TIME) ".
irlkaleI
(Ninja)
August 20, 2023, 8:07pm
#4
Doesnt work, but I found a work around.
Don’t forget to do your task.wait(TIME), as this is better because it will run the first frame after the time has passed.
nayro007
(zaza)
August 20, 2023, 9:04pm
#6
I said wait(Time) because both has wait, and I am using task.wait(). But I didn’t want to change the other persons mind, even though its better.
1 Like
Alright, I was just checking to make sure you’re not missing out on some resource benefits.
system
(system)
Closed
September 3, 2023, 9:08pm
#8
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.