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

How can I make a script where it tells you the items name in-game?

I know it has something to do with MarketPlaceService, but I dont know how to do it. :l

Smart Allec: English Please? What do you mean by that.

You know, how in Ryan's and Lua's admin when you do a commands like ;music or /music or musiclist it'll say the Name of the item in a Hint message.

1 answer

Try something like this:

function getItemName(itemId)
	local mps = Game:GetService("MarketplaceService") -- get marketplaceservice
	local item = mps:GetProductInfo(itemId) -- get the info about the product
	
	if(type(item) == "string") then
		--json, we need to decode it
		local Utils = assert(LoadLibrary("RbxUtility"))	--Library we need to decode JSON
		item = Utils.DecodeJSON(item) -- turn it into a table
	end
	
	return item.Name -- not sure about this line, tell me if it errors
end

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