local ItemID = script.Parent.Parent.ItemID.Value
local player = game.Players.LocalPlayer
function onClick(ItemID)
m = game:GetService("MarketplaceService"):GetProductInfo(ItemID)
for i,v in pairs(m) do
script.Parent.Parent.DIS_T.Text = (m['Name'])
end
end
onClick(ItemID)
script.Parent.MouseButton1Click:connect(onClick)
I'm using the script to get the name of an AssetID. When I click the button it does not work.
The output says:
18:32:12.670 - MarketplaceService:GetProductInfo() argument is not a valid assetId (supplied assetId was less than 0) 18:32:12.671 - Script 'Players.Player.PlayerGui.Catalog GUI.Frame.Search.GetInfo function', Line 2 - global GetInfo 18:32:12.672 - Script 'Players.Player.PlayerGui.Catalog GUI.Frame.Search.GetInfo function', Line 8 18:32:12.673 - Stack End 18:32:12.674 - MarketplaceService:GetProductInfo() argument is not a valid assetId (supplied assetId was less than 0) 18:32:12.675 - Script 'Players.Player.PlayerGui.Catalog GUI.Frame.Purchase.LocalScript', Line 5 - global onClick 18:32:12.676 - Script 'Players.Player.PlayerGui.Catalog GUI.Frame.Purchase.LocalScript', Line 11 18:32:12.677 - Stack End
This script changes the AssetID
function onClick()
wait (1)
local itemID = script.Parent.Text
if itemID ~= nil then
script.Parent.Parent.GetButton.Image = "http://www.roblox.com/Thumbs/Asset.ashx?x=420&y=420&assetId="..itemID
script.Parent.Parent.ItemID.Value = itemID
end
end
script.Parent.MouseButton1Click:connect(onClick)

1 comment
'm' is defined.