Best place to store player data folder that can be accessed both client and server

What is the best service to store player data? My previous choice was to store it in the player it self but I’m not too sure if there is any better way. If I was to store in Server Storage, the client won’t be able to see it.

Reason I want the client to see the data folder is for some UI’s.

1 Like

ReplicatedFirst sounds like a pretty good spot to put the folder

Always have the data stored inside of ServerScriptService or ServerStorage. The client won’t be able to access it directly.

Also, only have RemoteFunctions and RemoteEvents retrieving data. Never allow a client to set data directly using RemoteFunctions and RemoteEvents.

Validate messages sent to the server, check the data on the server, and only return visuals of the data to the client. If an exploiter opens the ReplicatedStorage per say, and opens your Data folder. It should be filled with “gets” only. For example, my game:

Screenshot_2

4 Likes

I guess to store them in the Replicated First as it replicated the data first.
I usually store some things that needs to be replicated first in the Replicated First.

I keep the tools inside the Server Storage.

thx for help…

(30 characters)

You store them in Replicated First, then parent it to the server storage whilist setting the name of the folder to the player’s name.

Replicated First loads faster so it is much safer to store them there and then parent it.

1 Like

I mean @Exeplex is right, you never want to trust the client. The best place to store the data is on the server. I personally store mine in ServerStorage. However, if the data you are wanting the player to see isn’t important such as a currency then you could store it in ReplicatedStorage or ReplicatedFirst as @hockeylover29 said.

You could also save the data in the ServerStorage and set the data in a folder in ReplicatedFirst or ReplicatedStorage that the player can see for UI’s while the data in ServerStorage is the main data that your game would actual use.
For example, if you give the player +5 coins and set it in the folder in ServerStorage and then you can set the value of the coin data to an instance in a folder in ReplicatedFirst or Storage. This would mean that even if someone changes the data from the client in the Replicated folder then it won’t affect the actual data of the player. I don’t know if that makes sense, it’s 3:15am. Hope it helps though.

1 Like

Ah, the good old days of updating client side data from the server constantly. All that carelessly used bandwidth to force sync server data with clients. The pain :sob:

I can hear the machine guns firing again.

You bet. I’ve just not done that once recently because I was having issues with certain data. Once I resolved that then I got rid of it, but remote events and functions make it much easier as long as you don’t mess up the code like I did.

I’m a bit confused by this discussion. I’ve always stored data in the player, the exploiter can see it sure, but they can’t edit it in any way, so there is nothing to lose by just putting it there. If you were to store it on the server, you would have to use Remote Events/Functions to get any of the data, and it would cause unnecessary lag.

Please explain this, I’m dumb and don’t understand it.

If its on the client it can be changed by an exploiter, and Remote Events/Functions do not cause unnecessary lag

But changes to the client don’t replicate to the server. So even if they were to edit a NumberValue inside the player, it won’t change anything on the server. Having to constantly use a Remote Event/Function to check the data WOULD cause lag. Say you have a TextLabel that displays the amount of cash the player has. If the player gains a lot of money in a short amount of time, it will spam that Remote Event to keep getting the players money.

Thought you were talking about the server getting the values from the client for purchases and whatnot, and constant RemoteEvents do not cause lag

No I’m talking about the client getting values from the server. Thats why I store it in the player, because both server and client can see it, but only server can edit it. In a big game, even a small amount of lag is still an issue, just because its not significant, doesn’t mean you can’t optimize it.

I prefer ServerScriptService, and do FireClient() / FireServer() if the client needs some data.

2 Likes

If it’s something that will update frequently just use a value object, otherwise fire a remote event from the server every time the data changes.