I have a folder for all my data values. Like level, money. Etc…
Where should I store this folder? I was previously storing inside the player, but I realized this can be exploited via client manipulation. So I’m not sure where I should put this?
I have a folder for all my data values. Like level, money. Etc…
Where should I store this folder? I was previously storing inside the player, but I realized this can be exploited via client manipulation. So I’m not sure where I should put this?
Not sure, you can probably create a RemoteEvent or RemoteFunction to add Extra Security like a combination to save data
Not in this case, if I store the data in client. Then the client can alter it. How would I keep it safe?
Where do most developers store this data?
Some Developers (Most) Store Data With Tables,
However, Im just saying, you can probably create a RemoteEvent to check if the Code entered is correct and if so, save Data, otherwise it wont.
Just an idea tho
Yea but then I have to do so many checks with every little increment. I’d rather just only make it possible via server script. Then I don’t have to worry about that.
So store with tables. How does that work? How would you access it from another script? Do you need to make a global table? Or do you just continuously load the data store with each separate script?
You need to understand how replication works. You can save the values inside the Player
instance. If the server is the one reading the data, it will be safe. If you have LocalScripts
reading/modifying the data, then yes, it is an issue. Otherwise, if a Script
modifies and reads these values, you shouldn’t be concerned about client manipulation.
Oh, does changing data in the player instance (locally) not replicate to server? I was under the impression that you couldn’t modify any client data with a server script? So you’d have to alter it with local script?
Yes, but the thing is, you can just write one line of code and it can give you (idk maybe) a billion dollars and since the Script detected the change (If you have it do that), it will save it.
Wrong. It will only give the money on the client side. The server data will remain intact. Just like ReplicatedStorage values, the data modified by the client DOES NOT replicate to the server.
If an exploiter modified their leaderstats it doesn’t mean that the data will be modified on the server as well. The changes the client makes to the Player instance will me unchanged on the server side. You can test this in Studio by toggling between the client and server.
I dont think you are understanding what im saying, for example, you can access the Dev Panel in a game you created, and change data from there, it WILL save, and with exploits, usually are replicated on the server, they can change their data like that
If the script that saves the data is a server script (ServerScriptService/Workspace), it will NOT save any data modified by the client.
Yea, but in my case. If these values (inside folder) are located in the player instance. How can I alter it unless with a client script? A server script can’t manipulate the values right? Like there is no server values here since they are in the player instant (client) correct? Or do I have that wrong?
So I’d have to locate these values somewhere else on the server, like workspace? Otherwise how do I alter the values only on the server if they’re located in the player instance.
Im not referring to the Client, im refering to a Server Change via exploit
The Player
instance is situated on the server, and replicated to the client. You are not saving the values to StarterGui, right? The Players
partition is a service that can be manipulated and read by the server. The client can read, but not modify the data (well, it can modify them locally only). Don’t misunderstand what the Player
is.
Oh okay, didn’t know that. Yea I create the values into the player instance via ServerScriptService
That answers that question thanks!
One more question, the other person suggested storing data stores in tables. But how would one then access it via other scripts? You’d have to load the data store over and over again. Seems kinda inefficient, rather than load it once into server ints, bools, etc…And then save that over the course of the game. Easy to access?
You would use _G
to create a Global Variable to be access by all scripts
_G.Table = {"hi"}
On Another Script:
print(_G.Table)
You can store the data in tables via ModuleScripts
. ModuleScripts
are tables themselves and can be manipulated and read by the server as well. However, if the Module is inside ServerScriptService, the client cannot reqire it.
Hmm, modulescripts can be manipulated though by client right?
Cause I need to change the data during the game, can’t have the client messing with that. And if I store it in serverscriptservice, that’s no good either. I need to read from client for UI stuff.
Isn’t _G deprecated?
If it isn’t. How does that work between server and client scripts? Or does it work fine between both?