Hello Everyone This is my first post! Anyways, Im trying to Get product info when a player types in an id for a song, but the problem is that I am getting a “Argument 1 missing or nil” error from the output when it tries to get product info
Here is my script (a local script in a guibutton)
local RS = game:GetService("ReplicatedStorage")
local MS = game:GetService("MarketplaceService")
local idbox = script.Parent.Parent.id
local texttonumber = tonumber(idbox.Text)
script.Parent.MouseButton1Click:Connect(function()
if idbox.Text == nil then
print("no id inputted")
else
local song = MS:GetProductInfo(texttonumber)
if song.AssetTypeId == 3 then
print("is a song")
else
print("not a song")
end
end
end)
(I have already looked through other posts but none of them answered my question)
I Thank you for your time!