I need help with a GUI script

I have been trying to make a GUI get updated to a variable but, I am not getting any error output and nothing is happening to the GUI. That would be great if you could help me.

Script:

local label = script.Parent.Text
local left = script.Parent.Bricksremaining.bricksleft.Value

label = left
label.Changed:connect(function()
	label = left
end)

1 Like

You have to use :GetPropertyChangedSignal()
If you change the text, the label does not get changed.

the code will be:-

local label = script.Parent
local left = script.Parent.Bricksremaining.bricksleft

label.Text = left.Value
label:GetPropertChangedSignal("Text"):Connect(function()
    label.Text = left.Value
end)

Also, when you make a variable taking a gui’s text, it changes the variable’s value to a string. So you cant change it later.

1 Like

Do you mean this?

local label = script.Parent
local left = script.Parent.Bricksremaining.bricksleft.Value

label.Text = script.Parent.Bricksremaining.bricksleft.Value

script.Parent.Bricksremaining.bricksleft.Changed:connect(function()
	label.Text = script.Parent.Bricksremaining.bricksleft.Value
end)

I know it changes it to a string so I used tostring() but that didn’t work
and I have tried implying this script but it still did not work even after adding a print function to see if it worked I still didn’t get any outputs or errors from the script. I even fixed an error of the label variable being incorrect. Thanks for trying to help, that means a lot.

here’s the modified script if you want to see it:

local label = script.Parent.Bricksremaining
local left = script.Parent.Bricksremaining.bricksleft

label.Text = left.Value
label:GetPropertChangedSignal("Text"):Connect(function()
	label.Text = left.Value
	if label.Text == left.Value then print("text=value")
		
	end
end)

You may not have changed the value of label.
also, u already set its value to left’s value so what r u trying to do exactly?

I know that I changed the vale of the variable because I am printing it, and I am trying to make the GUI read what the variable is but, it is not doing that.

and sorry I took so long to reply I had to go