Roblox how to see if a player is playing your game?

So I want to make a global leader board with players stats it will be displayed on a part with a gui .And next to the players stats there will be a circle to show if player is online (Online as inside one of my games) Green will show players is in my games and red is not.

When they enter the game and when you load their stats update their status for the leaderboard stores, and when they leave simply update it again.

1 Like

Hey Lua_Basics

So I can make a variable in their datastore table that says example {online = false}
Then when they enter game it updates that value to example {online = true} then when I when I update the global leader board stats I just find their table in datastore and see what that value is

Is that correct?

Yeah you could have your OrderedDataStore loop go through and check if they are on the leaderboard. It’d only be a few people or however many you actually have on the leaderboard. Just check their individual datastore for the value and update to that. It’d be pretty easy, or even use the new service and just tell the servers when they are on or offline.

There a ton of different methods but these are extremely simple and easy options.


If the player is your friend you can see the user if the user is playing your game. More information in here…

Good Luck :grinning:

1 Like

You have 2 options. You can use MessagingService (Which isn’t out yet) to update all servers once the player joins, or you can just set the data store to online and then have the leaderboard collect from the data store every few minutes if they’re online. The MessagingService option is a lot more reliable and clean. You can visit the beta applications, and try it yourself!

1 Like

Please don’t ask for free code or others to write/design entire scripts for you, this is a support category:

Please follow guidelines in the future, and please attempt to make this yourself first, then come back with specific questions/issues that you get stuck on, after you attempted something yourself.

1 Like