Im making a simulator and when i fill up my backpack the gui comes but if i fill it a second time it dont pls help
the code is
local amm = script.Parent.Ammount local max = script.Parent.Max while true do if amm.Value >= max.Value then game.Workspace.Values.Bool.Value = true end script.Parent.Text = "" .. script.Parent.Ammount.Value .. " / " .. script.Parent.Max.Value wait(0.05) end
the two variables are int max = 10 ammount = 1
and the script is inside a text label
local amm = script.Parent.Ammount local max = script.Parent.Max amm:GetPropertyChangedSignal("Value"):Connect(function() if amm.Value >= max.Value then workspace.Values.Bool.Value = true end script.Parent.Text = "" .. amm.Value .. " / " .. max.Value end)
getpropertychangedsignal only fires when the specified property in the parenthesis is changed so it is better optimized than a while true do loop