I know this can be easily achieved using GetProductInfo function of MarketPlaceService. However, it seems that this would only work when the shirt is uploaded to a person (and not to a group).
GetProductInfo is super handy for getting a creator’s username, but if a product is uploaded to a group, it cannot get you the exact uploader’s username.
From what I’ve seen on both GetProductInfo and roblox’s API, they only either return the user’s UserId or the group’s GroupId. I believe at this time, without some crazy hacky method that I’m not aware of, this is most likely not possible, at least until roblox adds in functionality for something like this.
I got an idea how to get the uploader’s ID even if the shirt is uploaded by a group, not user. My idea includes changing the shirt’s description to:
| Made by: SynxChazz |
[the rest of the description here]
To make it work with other shirts of the group, changing descriptions to that pattern is required. @slothfulGuy, do you want to use my idea?
If you don’t find an official way to do this, you could always parse the raw HTML as a string. You’d get the HTML using HttpService, but you’d have to use a proxy website like rprxy.xyz since Roblox doesn’t allow direct access to roblox.com.
Use description pattern:
| Made by: USERNAME |
[the rest of the description here]
For this shirt USERNAME should get replaced with SynxChazz.
Scripting:
local players = game:GetService("Players")
local marketPlaceService = game:GetService("MarketplaceService")
local productInfo = marketPlaceService:GetProductInfo(6663030466, Enum.InfoType.Asset)
local description = productInfo.Description
local splittedDescription = description:split("")
-- For testing I changed the actual description here
description = "| Made by: SynxChazz | An amazing description!"
splittedDescription = description:split("")
local creatorName = ""
for i = 12, string.len(description) do
if splittedDescription[i + 1] ~= "|" then
creatorName = creatorName .. splittedDescription[i]
else
break
end
end
print("The creator's ID is:", players:GetUserIdFromNameAsync(creatorName))
This script prints creator’s (or uploader at least) user ID.
It’s notpossible to receive the uploader’s ID - instead, it’d return the group ID, if made in a group, as you mentioned beforehand, and is stated on the API documentation.
An alternative way of getting the uploader’s (user) ID is how @Spiderr12PL explained - with the description, however, it’s dependant upon the structure of the text.