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

GUI wont change?

Asked by 8 years ago

So there is a money GUI, this script is inside the TextLabel inside of that GUI. All I want is the text to be the same as the number value. So in other words, it to show how much money the player has. No output errors or anything it just wont show. It's in a Localscript btw:

local player = game.Players.LocalPlayer
local money = script.Parent.Money.Value
local gui = script.Parent

while true do
    wait(0.1)
    gui.Text = "$" .. money
end

Money is the name of the NumberValue. Gui is the Text Label. Player is well, the player. Any help is appreciated :)

1 answer

Log in to vote
1
Answered by
Shawnyg 4330 Trusted Badge of Merit Snack Break Moderation Voter Community Moderator
8 years ago

In the variable, don't add '.Value', as that'll only represent the value when you defined the variable. In other words:

local player = game.Players.LocalPlayer
local money = script.Parent.Money
local gui = script.Parent

while true do
    wait(0.1)
    gui.Text = "$" .. money.Value
end


Ad

Answer this question