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.
1)
local service = game:GetService("MarketplaceService") creator.Value = service:GetProductInfo(1000000).Creator[1]
2)
local service = game:GetService("MarketplaceService") local values = {} values = service:GetProductInfo(1000000).Creator creator.Value = values[1]
3)
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?
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.