Text is not reading Value after time

This one is weird…


How you can see in video, the clock (using value) works, but the money value doesn′t

The Money Value Label Text is “Label”, so it reads only one time.

Script I am using:

while true do
	wait(0.5)
	script.Parent.Text = script.Parent.Parent.Money.Value
end
2 Likes

GetP
Use Instance:GetPropertyChangedSignal ? :thinking:

1 Like

I used this script:

script.Parent.Parent.Money.Value.Changed:Connect(function()
script.Parent.Text = script.Parent.Parent.Money.Value
end)

And now it shows nothing (in this case Label)

Properties do not have built-in events, your indexing the Value property to .Changed which only exist in the object itself, the changed event works as if any property in the object has changed, while you could use it, but its still better to use :GetPropertyChangedSignal('Property') since it only fires when that specific property changes:

script.Parent.Parent.Money:GetPropertyChangedSignal("Value"):Connect(function()
script.Parent.Text = script.Parent.Parent.Money.Value
end)
1 Like

Same result…

Check the output for any errors?

Nothing

1 Like

Your using a server script, which doesnt run in PlayerGui due to FE, so create a new LocalScript inside of the label and paste the code.

1 Like

Still the same result…

The number literally changed what do you mean?

local label = script.Parent
local moneyValue = script.Parent.Parent.Money

moneyValue:GetPropertyChangedSignal("Value"):Connect(function()
	label.Text = tostring(moneyValue.Value)
end)

its clock. I mean the one upper left

Same result…

First of all, does the function run when the value is changed? Add a print and see.

Your changing the money value inside of starterGui, its not like that, the starterGui just copy and pastes everything thats in it and puts it in the player’s PlayerGui, you could go to that playerGui by going to Players → [Your player name] → PlayerGui → [Your gui’s name] and change the money value from there.

You know we’re using script.Parent and not StarterGui

Yea? How does that affect the starterGui copying everything to the player’s playerGui?


No, it doesn′t

1 Like

I can’t see if he was editing the value in StarterGui or it’s a script changing it

How does your “money” Value update? Got the script for it?