MarketplaceService:GetProductInfo() called by RemoteFunction not working

I tried to run this code and it is not returning anything. And when I say anything, I mean anything at all.

local MarketplaceService = game:GetService("MarketplaceService")
local getName = game.ReplicatedStorage:WaitForChild("getName") 
local plr =  game.Players.LocalPlayer
local module = require(script.Module)
local radio = module:GetRadio(plr)
local function getNameInfo(plr)
print("1")
local radio = module.GetRadio(plr)
local sound = radio:WaitForChild("Music")
local stuf = MarketplaceService:GetProductInfo(sound.SoundId)
	return stuf.Name
end
getName.OnServerInvoke = getNameInfo

and it returns nothing, setting a TextLabel’s text to the value does not change the text at all.
the

print("1!")

does not even print in the output, can anybody help explain this to me please? Thanks!

There are two scenarios:

  1. The RemoteFunction is not invoked by server, check server code.
  2. Script misplaced, LocalScript does not function in all places.
2 Likes

You need to put an InfoType, more information here: MarketplaceService | Documentation - Roblox Creator Hub

1 Like

u messed up at the printing add another string before the ending parenthesis

Sorry, that was a typo i made on this post, not on the script.

Thanks! I’ve moved the code to the server and now it works perfectly! Forgot that I was writing in a local script at the time :sweat_smile: