Hello, I have a problem.
When a player joins, the server sends a RemoteEvent to the client to assign a camera focused on that player's base.
The problem is that when more than one player is in the game, the previous players' cameras change and point to the last player who joined.
Maybe the problem is with ModuleScripts.
I use a ModuleScript to store all the data for each player when they join. After that, I send it from the main script using a RemoteEvent. Here are the steps of the algorithm:
1-A player joins, and the DataStoreScript retrieves all the data for that player.
2-The data is stored in the ModuleScript.
3-The DataStoreScript uses a BindableEvent to notify the MainScript that the player is ready.
4-The MainScript sends the player’s data to the client using the ModuleScript, like this:
(PlayersData is the moduleScript name)
PlayersData[player.UserId]
5-The client receives the data sent by the server and sets up a GUI button that, when clicked, makes the camera focus on the player’s base.
(The client prints the correct data, and everything seems fine — but the camera always ends up pointing to the last player who joined.)
So, I don’t know what to do. Here is the code, friends.
Any help would be greatly appreciated.