So i was making a loop in a script that takes the value from a number value and puts it in a gui.

local function SetMoney()
	MoneyText.Text = Money.. " $"
end

while true do
	SetMoney()
	wait()
end

The "Money" variable is the value of the number value while the "MoneyText" variable is the textbox in the gui. When i change the value of Money, the textbox does not change. Why?

2 comments

0

make sure to not say "local MoneyText = game.StarterGui" in your script, never use game.StarterGui... If that is the issue, change it to script.Parent... Also use .Changed and not a loop for less lag and more performance.

0

Im currently doing script.Parent and i tried using .Changed but it didn't change the outcome.