Is this method of containing and changing player's data better?

Sorry if this is in the wrong category, I don’t know where else to put it.

So I’m trying to think of a better way to contain a player’s data and here’s my method:

There are 2 values for 1 data: one on the server and one on the client. Every time the value on the server change, it will fire a remote event to the client to change the value on the client(so it can show on the GUI).

My question is: Is this method better than changing the data directly in the player or I’m wasting time on making the same thing?

I do not think so. I think you are all set! I do not know a better way to do this. Just make sure everything is nice and organized in a module and your code is clean.

I would not like this solution. Remember, anything done on the server will replicate to all clients.

In your case of showing the value in a GUI, do a Changed or GetPropertyChangedSignal in the player’s value and connect that to the GUI. If a property or specific property changed, you don’t need to fire a remote event. The client will just listen for a change in the server.

Can you explain more about

I thought the client doesn’t have access to the stuffs inside the server. So how can I listen for a change?

Put the value in a place where it will replicate and where the server has access to it (a good object is the Player object).

From there, when the server updates the value, it will replicate to the client. If the client tries to update the value, it will be overridden by the server.

Attach a changed signal to a GUI and update the GUI when the value changes

So that means I’m just wasting time doing this and I can just simply save the data in the player?

Well potentially. If you’re paranoid enough then no but really it’s ok to store stuff in the player. Just never trust anything the client is telling you is all.

Oh ok. Thanks for helping me anyway.