Show player stats on GUI from sever storage

Wasn’t sure if I should post this in Scripting support or here. Currently trying to figure out the best method for telling a player how much money, xp and level they have from there starts which is located in serverstorage. The stats would show on a GUI. Right now I have their stats also duplicated in replicated storage. When the sever stats change the replicated stats update, and when that updates the GUI updates. However, would a better method be to fire an event to the client to tell them how much and when to update on the GUI? Sometimes the replicated storage doesn’t update when the sever storage does…

I think scripting supports your best bet for this!

I would use the leaderstats function.

More Info

I would recommend firing an event because it gives you more declaratory control over the information that you are passing to the client. You can allow the client to request information by firing an event to the server, and the sever itself can accept/decline requests or just send an event to a client to update their stats whenever nessecary.

If you want to identify the stats which are located in ServerStorage in a client-sided script, then i don’t recommend you that:

ServerStorage can be accessed by only server-sided scripts. You can use ReplicatedStorage instead.

I would make it so when the server storage value changed the replicated storage value changes, which you have already done. Make sure that it is not the other way and the replicated storage value cannot change the server value. If you allow the clientside value to change the actual server value then exploiters could easily manipulate the stats. So I think this is an effective way to do this.