local function ChoiceClicked(Icon, InfoText, Category, Thinking, Stamina, Health)
for i, v in pairs(infos:GetChildren()) do
v.Visible = false
end
InfoText.Visible = true
script.Parent.Icon.Image = Icon
script.Parent.Category.Text = Category
if Thinking == 2.5 then
--blah blah blah
elseif Thinking == 3 then
-- a lot of unnecessary code
end
end
script.Parent.Parent.ChoiceFrame.Agriculture.MouseButton1Click:Connect(function()
ChoiceClicked(proffesionIcons["AgricultureIcon"], infos.AC_Text, "Agriculture", 3, 4, 5)
end)
So I was just wondering if there is a better way to do this, all tips are welcome.
If there is going to be a background like in the pic you showed, you can just make a regular progress bar with small black notches over it to make it look like bars:
The progress bar could then just be a green bar on top of a gray bar whose size scale is between 0 and 1 depending on how full the bar should be.
You can take the amount of health the player has, and divide it the max amount of health. Then divide that number by the amount of bars you have. You can use math.floor(dividedNum) to get the amount fo full bars. Fill those bars in completely. Then get the divided number and subtract it by the math.floor number. That will give you the amount of space you need to occupy in the next bar.