Get Studio "Player"

This is an odd question, but is there a way to get the Studio user’s “Player”? I don’t mean in test mode. The Studio “Player” only seems to appear in Team Create, but not in solo.

Let’s say I were writing a plugin and wanted to check if the player owned a certain item, or were apart of a certain group, or anything like that which would require a “Player”. Is there a way to get said “Player”? Or maybe get the UserId of the Studio user? CreatorId only works in a published game, and only if it’s a non-group game.

Thanks

4 Likes

You can print the ids for Player1,2,3,4 and so on and you will see they are -1 -2 -3 -4. I don’t know if this helps you though.

I just want to get either the UserId or Player object of Studio. In short, I want to check if the person using my plugin has a specific item.

You can get the owner’s id with game.CreatorId and then use it to check for groups or items.

While that works in most cases, that sadly doesn’t work for unpublished or group hosted games.

1 Like

Wow, I’m sorry. I totally missed the part you said that.

It’s alright. However, it seems even with game.CreatorId, it doesn’t work in a non-Team Create game as shown here:

local M = game:GetService('MarketplaceService')
local P = game:GetService('Players')
local p = P:GetPlayerByUserId(game.CreatorId)
local owned = M:PlayerOwnsAsset(6312892237,p)
print(owned)
- 08:58:11.051  Argument 2 missing or nil  -  Edit
  08:58:11.051  Stack Begin  -  Studio
  08:58:11.051  Script 'local M = game:GetService('MarketplaceService')
  local P = game:GetService('Players')
  local p = P:GetPlayerByUserId(game.CreatorId)
  local owned = M:PlayerOwnsAsset(6312892237,p)
+ print(owned)', Line 4  -  Studio
  08:58:11.051  Stack End  -  Studio

I also just realized that CreatorId will get the actual CreatorId and not the Studio user’s Id.

1 Like

You could use this:

But this only works in the command bar and in plug-in scripts.

4 Likes

That is very close to what I need, thank you.

Sadly, I apparently can’t get a “Player” out of a UserId without the player existing in the Player list. Is there another way to see if a player owns an item via Studio?

I suppose I could theoretically use a one-time verification setting using plugin settings that save, but that would require the user to open a team create just for verification, which isn’t ideal.

I wish there was just a plugin:GetPlayer() or plugin:PlayerOwnsAsset() type of thing.

Unfortunately, that’s the only way (that I know of) you can use to get the Studio User’s Player without team create or playtesting.

I suppose I’ll have to make it work then. Thanks for the help.

Also, I guess I can just use test mode instead of Team Create. That’ll require less effort from the user.

Maybe you can try something with Roblox API.


You can get information about the groups here:

https://groups.roblox.com/v2/users/{user_id}/groups/roles

About an item, you can use this route, however, you won’t be able to see a private inventory:

https://inventory.roblox.com/v2/users/{user_id}/inventory/{asset_type_id}?sortOrder=Asc&limit=10

If the item is a gamepass, try this (works with private inventories):

https://inventory.roblox.com/v1/users/{userId}/items/GamePass/{gamePassId}


https://groups.roblox.com/docs#!/Groups/get_v2_users_userId_groups_roles

https://inventory.roblox.com/docs#!/Inventory/get_v2_users_userId_inventory_assetTypeId

1 Like

I think that not only requires HttpService to be enabled, but also to have the user’s inventory set to public.

In the meantime, I think I’ll just have to require the user to enter Test Mode once to verify and then save the results in the plugin’s settings.

1 Like

I don’t know what you’re doing, but if it’s supposed to be exclusive for players who own the item, it can be manipulated changing the plugin settings json file. :slight_smile:

The settings will be encrypted and the plugin code itself will be obfuscated (and doesn’t require loadstring).

1 Like