I got a question possibly regarding remote events or functions

Hey so I just asking a real quick question. So I have a leaderstat that ofc gets instanced into Player Service when the player joins. And I have made a coin collecting mechanic where players pick up coins and such within a module script. But that is besides the point…

When players pick up the coins I want to give them points you know to the leaderstat. But since the module and script are all server sided, I can’t access the leaderstat because it’s in the Players Service which is client sided. So could I by chance use remote events or functions to send information from the server sided script which is the coin pick up and have it send information to update the leaderstat which is within the Player Service?

If so then I could use that as practice to finally use remote functions or events.

Preformatted textYou obviously can, that’s exactly what RemoteEvents are for

Actually, you don’t need to do this at all, because you can just put leaderstats on the server (yes, you can use game:GetService("Players") on the server), and you can modify the leaderstats with a server-sided script, and it will replicate to all players. You don’t need to send the data across the client-server boundary via a RemoteEvent / RemoteFunction and then use a LocalScript on the client, you can just let Roblox do it for you.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.