Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why does the while true do loop not work and change the text?

Asked by 4 years ago

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?

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. greatneil80 2647 — 4y
0
Im currently doing script.Parent and i tried using .Changed but it didn't change the outcome. 20002000sa 83 — 4y

Answer this question