Hello! I’m trying to make a progress bar for various statistics. However, the tweening (sizing) itself doesn’t work. I printed the Progress
variable and it returns 0 every time, even when the CurrentCoal
value changes. Not sure why it does that, because it really shouldn’t be 0.
local Players = game:GetService("Players")
local TweenService = game:GetService("TweenService")
local plr = Players.LocalPlayer
local Values = plr:WaitForChild("Values")
local MaxCoal = 25
local CurrentCoal = Values:FindFirstChild("Coal")
local Progress = CurrentCoal.Value / MaxCoal
local Button = script.Parent
local StatusText = Button.Status
print(CurrentCoal.Value, Progress)
local tween = TweenService:Create(Button.ProgressBar, TweenInfo.new(0.2,Enum.EasingStyle.Linear,Enum.EasingDirection.Out), {Size = UDim2.new(Progress, 0, 1, 0)})
tween:Play()
StatusText.Text = CurrentCoal.Value.."/25 INVENTORY COAL"
CurrentCoal:GetPropertyChangedSignal("Value"):Connect(function()
print(CurrentCoal.Value, Progress)
tween:Play()
StatusText.Text = CurrentCoal.Value.."/25 INVENTORY COAL"
end)