Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Backpack full gui script wont come up, please help?

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

1 answer

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

3 comments

0

no

0

it dont work but i think the problem is the frame not becoming visible

0

im using another script to check if its true then making a frame visible

This discussion is preserved as it was. New answers, comments, and votes are closed.