So i have my leaderstats stored in a gui and in the player.
But i want the server to also acces the leaderstats, the leaderstats are handled by a localscript so you can’t get them via the server.
I also thought about use a remote event, but sending playerdata/leaderstats trough a remote event gives exploiters the chance to change it easily .
so is there any way for me to save playerdata to the datastores without having to use a remote event.
This is not safe at all. You really should store it on the server, ina folder somewhere (like replicated storage or the player) and then have the local script read data. Everything on the client is changeable by exploiters. So when we are talking about using remotes and passing information, You shouldn’t need to, as you should use it on the server.
i have my data store on the server in serverscript service, but i want to save my data from the clients gui to the server without using a remote event.
I have the localscript read the leaderstats from the player inside the player leaderstats. but any changes made to the leaderstats can’t be seen by the server bc it is changed by the client
Your going to have to use some sort of remote. My idea, is to Use a remote function. Whenever a score is calculated, use a Remote function and fire it in the server. The client then preforms the math and get the score, and uses ‘return’ to the value. While this isn’t bulletproof, it’s atleast better then a remote event sending the value via the server
I’m not on my computer right now. But it’s a couple more lines to handle this. If it takes longer then a certain amount of time, you then remove the request and try again if possible. But this is the best you can do which is better then just having it spilt out errors
But again, I would want to calculate this on the server and not rely on the client
so the server sends a message to the playergui asking for the “highscore leaderstat” and the client sends it back to the server using “return” and then the server saves it?
But again, I would want to calculate this on the server if possible. If you absolutely have to, then yes, but please reconsider just storing the value on the server
I’m pretty sure you can use a connection and check. And then if you don’t get a result, you disconnect the connection to the function, so it stops running so it stops infinity yielding
i use (startpart.Position - player.Character:GetPivot().Position).Magnitude idk if that can be done on the server bc it starts to calculate after the client receives a .event from a bindable even from the “press start” button.
and if its possible then idk how it would handle multiple players at the same time?
What? - The problem with passing data through a RE is NOT the usage of the RE itself, rather, it is that you are passing Client data: information that is manipulable by the client, thus the player, to the server to store it.
Seen a visual hack? - Well, these work because you are modifying the data YOU see. If you let hackers pass that data to the server, then what you are doing essentially is giving them a way of making visual hacks real.