Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Getting the creator of an asset?

I know you can get the creator of a specific asset by using GetProductInfo() from the MarketplaceService. However, the specific Creator return value returns a table with a String and an Integer, not just a String. I need just the String value. Here are some of the methods I have tried to use:

NOTE: Variable "creator" is a StringValue object.

local service = game:GetService("MarketplaceService")
creator.Value = service:GetProductInfo(1000000).Creator[1]
local service = game:GetService("MarketplaceService")
local values = {}
values = service:GetProductInfo(1000000).Creator
creator.Value = values[1]
local service = game:GetService("MarketplaceService")
local name, iDontNeed = service:GetProductInfo(1000000).Creator
creator.Value = name

For every single one of these methods, I have gotten this error: bad argument #3 to 'Value' (string expected, got nil)

Is there a way to get just the String from the table?

1 answer

✓ Accepted answer

The way to do this is as follows:

local service = game:GetService("MarketplaceService")
local info = service:GetProductInfo(1000000)
creator.Value = info.Creator.Name

I've never actually used MarketplaceService before; I'm just going by the wiki. Regardless, I hope this helps.

1 comment

0

Wow! It was that simple? I'm facepalming so much right now. I guess I have a tendency to overthink things. Also, the fact that it said that it returned a table was what threw me off by a lot. Anyways, thanks!

This discussion is preserved as it was. New answers, comments, and votes are closed.