How would I check stats of a user not in game?

So, I’m wondering how I would get stats of a player not in game. Like, for example; I grab a random user id, how would I see if the player with that userid has premium? I can’t get them from the players service, as, they aren’t in game.

3 Likes

I don’t think you can. But may i ask. Why are you wondering how to get a player’s stats if they arent ingame. Although if you use datastores you MIGHT be able to

I’m making a random character generator, but, all the characters are just throwaway accounts, so I want to have it check if the user is premium, if it’s not it will restart the process, if it is, it will load the user.

I think this might help Player | Documentation - Roblox Creator Hub


Did you read my question? This is a player property. Referring to the player instance. I cannot get the play instance, as the player is not in game.

cant you still get the player ID and check it’s membership using .MembershipType if not i am of no help

I can’t get the player instance to use this property, as the player is not in game.

Is it like you want to get player stats from gui?

No. This is not a gui. I don’t know why you would think that.

Is it roblox premium or Premium developer product

I am not offering any product or doing any prompts. I want to see if a player that isn’t in the game, and hasn’t ever been in the game has premium, and other stats.

There isn’t anyway to do this afaik. You can store values related to the player’s membership details to a Datastore when they join, but I don’t think there’s a way of checking global stats of every player - unless there is an API for this that I am unaware of.

2 Likes

I’m unsure if there is any practical way of doing this besides math.random(1,1000000000) or however many accounts there are and making sure they aren’t banned and have premium, but that would take forever as many are bots and don’t have premium and 1B is a lot.

This doesn’t relate to my issue? I’m fine with the user generator, I’m trying how to get stats from players not in game, and never have been in game.

So, you can’t really do that as far as my knowledge unless you make a table with specific players. On the other hand, the only logical way to do it would be by letting the player join the game, then check the stats. You could also get it by typing a UserID in a textbox if this is related to what you are doing, and then checking if the User have premium.

Another way you could do this is getting all the players user ids in a massive table then accessing them, I wouldn’t know how in the world you would do this, but it should be possible…

(Sorry if this does not help you).

1 Like

Use UserService:GetUserInfosByUserIdsAsync() since it’s used to check player’s property even if he isn’t in the game

Article: UserService | Documentation - Roblox Creator Hub

But it sadly can’t get the MemberShip type. Only Username,Id and DisplayName

And you can also use Players:GetUserThumbnailAsync() to get its avatar image

Article: Players | Documentation - Roblox Creator Hub

Otherwise use Data stores to read user’s data even if he isn’t in the game

Article: Data Stores | Documentation - Roblox Creator Hub

Hope that helps! (and no im not trying to spoonfeed or neither solution farm im just here to help and sorry if the reply is spoonfeeding someone)

5 Likes

You can use a web request to do this. I haven’t learned web requests yet. Here is the Get API: https://premiumfeatures.roblox.com/docs#!/PremiumFeaturesUsers/get_v1_users_userId_validate_membership
And here is the request async function.
HttpService | Documentation - Roblox Creator Hub
I think you might need a proxy though because roblox might block requests to themselves.

5 Likes

There really isn’t a way to do this without a proxy to make requests to Roblox’s web APIs.

The lack of a method to retrieve this info is probably intentional. You should always avoid trying to do anything with players who have never been in your game, because the vast majority of user IDs on Roblox belong to throwaway accounts like bots.

You should probably consider rethinking your strategy. Roblox’s user IDs are essentially a very large and very sparse array. Finding anything meaningful out of all the ID numbers is astronomically improbable. It’d likely be more meaningful to your game if you used the friends lists of the players in your game, anyway.

1 Like

Well, I know about that. That was the main purpose in this question. I wanted to automatically detect premium users and use them instead, because they are less likely to be a bot. Also, it should probably allow me to make the npc name’s not just userids and actual names. (I made them userids cause on one of my first test I encountered an inapropriate username.)

It doesn’t matter if you can check if a user has premium in that case. You still have to sift through millions and millions of user IDs. This isn’t really a question of if the API exists at that point. It can’t exist. The sheer scale of the dataset makes this barely possible, let alone feasible.