Is it a good idea to put a script or other instance into players.player?

If it’s in the wrong category, correct me.
Is it a good idea to put a script or other instance into players.player? For example, int value (as in the leaderboard) but outside the leaderboard tab so that the player’s value is not visible in the player table? The same with scripts so that I can better identify the player for whom the script works. therefore, there would be 1 script for each player separately, and it would have it in a tab on the server side. ) I don’t know if I explained well.

1 Like

Yes you can do this put scripts and values

Personally I would say this is not a good idea. consider the following

  • all Players descendants are replicated to all clients. that means that any information you put in there will be available to everyone (mainly hackers).
  • you should always keep your code base as tidy as possible. Where you place a script it should follow a consistent logic at all times. It is not mandatory, but it is quite valuable when the game gets bigger.

Well, how could a timer be made for each player separately (he can also run it whenever he wants and if he wants to) and especially so that it is on the server side. Because it is easy for the client, but he can do what he wants with it and falsify the results. (The problem for me is that the player can/may not start and when he wants to. Other things I would know)

Player descendants are not replicated (at least surely not all of them), they are mostly local things.

E.g. putting a localscript into Player1’s PlayerScripts folder with an ObjectValue child, it won’t be replicated to other players. It’s true that it will be available for hackers on client side (e.g. hacking from the client, but not to directly harm other players).

The value keeps its value on player respawn.

image

The leaderboard is intended to contain public information within a game and any other information within Players will have the same feature. Another important thing is that the replication is from server to client and not from client to server so hackers can only modify the information on their own machine, not on the server (sorry for not clarifying that).

The question is: would the information you put inside Players (apart from the leaderboard) give an unfair advantage to any player? Although at the beginning you would have very clear the answer, the game will surely change. even after it is finished (improvements or updates can always be added) and it is not so simple anymore. then some very ingenious hacker could find a way to take advantage of any available information. That’s why it’s best to provide clients with as little information as possible.

What you could do is create a folder called Players in ServerStorage and place all player information there. Then you would use RemoteEvent/Function to replicate that information. Many games are done this way.

Not exactly, remember that the content of PlayerScripts is copied from StarterPlayerScripts. Then it depends on how you created the ObjectValue.

If the information is not residing back to the server, this is a good thing. He won’t have the advantage of seeing it because he’ll see it. Only then can the hacker see the content of the script probably not because it belongs to the server.
But I’m probably more likely to create a folder with players and values. That I hadn’t thought of it before.
And I will replicate their time (value) But not every second. I will also give the player a local script that will count down as well as to the server, but the server will be the main one. The local one will only be for the info server or correct it to match.

Uh, the translator messed it up. It’s totally wrong.

No worries. I get your point.

That’s a good idea. Good luck.