Not sure why but it doesn’t work as in the interface does not show the correct number of coins/gems.
Value is supposed to change on client-side gui as of the second picture. The actual values of the coins are functioning in which the IntValues reflect the correct data. 685 in this case, but despite being loaded in, the gui text does not change.
I’m not making a change on the server. The script is a datastore script in which it loads the values for coins and gems in the folder “Values”. The local script which is the one shown in the original post is checking if there are any changes to it, which then would display the values on the player’s screen (as seen on the 2nd picture), there is no changes made with the local script in regards to the values.
The problem is that .Changed and now PropertySignal doesn’t work, as it doesn’t track the values being changed on the ServerSide. What’s weird about this is that it previously worked as intended.
I still think the issue is that the client is not getting the change you are making from the server.
Have you tried to, instead of Changed:Connect, instead
just put a task.wait(10) and then do print(coins.Value) to see if the client is even getting
the value or not.
I think your first part was correct.
I checked using the task.wait() idea you suggested, and it turns out that it returns 685 for both before the wait and after. I’m not sure if this is a characteristic of DataStore, but this explains why .Changed doesn’t work.
If the client is seeing the correct value, but Changed is not firing, then the datastore is changing the value, before the local script has time to set up the .Changed handlers
Probably if you put a task.wait(10) in the datastore script, to give the client time to set up the .Changed handler, I bet you would see it fire the change.
Maybe to solve this, is to read the values from the coins.Value, and others just after you set up the .Changed handlers, and set your gui to a starting value of this.
I’ve tried to set the text initially as the starting value of the player’s data coins like you’ve said, but for some reason it doesn’t work either and its stuck on 0.