So basically, I have this soccer system that has different modes like “Dribble”, “Shoot”, and “Lob.” The player is switching these modes on their client-side, so I’m wondering what the best way to handle this is? Should I have a system where it keeps and stores these values somewhere and updates whenever the player changes their mode and use that? Or should It be something where when the player hits the ball, then that’s when the server will retrieve their current kick mode right away?
(Sorry for lack of explanation, it is a touch soccer ball system that I want to have different modes for kicking, ball is handled on server)
I also don’t quite understand the issue, is it that you’re wondering whether to store it in a table or in values parented to the player, etc?
Since it’s on the client side, you could 100% just keep it in a module script. However, it feels like something that should be on the server, just a programmer hunch.
I’m not the one making your game though, so my recommendation is to have a module script in replicated storage, make a table, and make a function that updates the table based on the player’s mode.
you won’t have to worry about assigning a user id to the mode or any identification of the player besides key parameters since the module should only be used on the client.
I meant that whenever the ball is touched the server will need to fetch the client’s mode, so im wondering the best way to store it is? thru a value inside the player that updates when they change their mode? or just fetch it right away when they hit?
Me personally, I suggest making gui buttons for mobile and make keybinds for computer instead of tools for a better experience, But setting each mode as a tool is the easier option.
Basically I have a ball that is completely handled by server. BUT my “modes” system is handled on client side. So basically I will need a way to communicate the server that player mode. But I was wondering if it was better to store a value inside the player with their current mode and update that constantly? or get the info right away when a player wants to hit the ball?
You can update the value each time the player switches modes, just not to over do it. But if you get the info right after touching the ball, it could be less stable and could trigger the wrong mode.