Rekotora3349
(Re_koFromSlovakia)
December 29, 2022, 1:16pm
#1
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 ?
1 Like
Rekotora3349
(Re_koFromSlovakia)
December 29, 2022, 1:38pm
#3
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)
mroaan
(NightCode)
December 29, 2022, 1:54pm
#4
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
mroaan
(NightCode)
December 29, 2022, 1:59pm
#6
Check the output for any errors?
mroaan
(NightCode)
December 29, 2022, 2:05pm
#8
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
mroaan
(NightCode)
December 29, 2022, 2:09pm
#10
The number literally changed what do you mean?
Vanniris
(Vanni)
December 29, 2022, 2:09pm
#11
local label = script.Parent
local moneyValue = script.Parent.Parent.Money
moneyValue:GetPropertyChangedSignal("Value"):Connect(function()
label.Text = tostring(moneyValue.Value)
end)
Rekotora3349
(Re_koFromSlovakia)
December 29, 2022, 2:09pm
#12
its clock. I mean the one upper left
Vanniris
(Vanni)
December 29, 2022, 2:12pm
#14
First of all, does the function run when the value is changed? Add a print and see.
mroaan
(NightCode)
December 29, 2022, 2:12pm
#15
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.
Vanniris
(Vanni)
December 29, 2022, 2:13pm
#16
You know we’re using script.Parent and not StarterGui
mroaan
(NightCode)
December 29, 2022, 2:14pm
#17
Yea? How does that affect the starterGui copying everything to the player’s playerGui?
Vanniris
(Vanni)
December 29, 2022, 2:15pm
#19
I can’t see if he was editing the value in StarterGui or it’s a script changing it
Vanniris
(Vanni)
December 29, 2022, 2:16pm
#20
How does your “money” Value update? Got the script for it?