I’ve tried different methods but for some reason I can’t get the robux cost of the player’s asset. I’m making an asset tipping system where players can get their own shirts/pants/etc. and have it to be their donation options.
local function getProductCost(assetId)
local productInfo = MarketplaceService:GetProductInfo(assetId, Enum.InfoType.Asset)
if productInfo and productInfo.PriceInRobux then
return productInfo.PriceInRobux
else
warn("Failed to get asset cost for asset ID:", assetId)
return "N/A"
end
end
--[Announcement Handler]
game.ReplicatedStorage.Donation_Announce.OnClientEvent:Connect(function(assetId, donator, recipient, announcement_type)
if announcement_type == "Major" then
print("Major Donation")
-- Hide necessary UIs
script.Parent.Frame.Visible = false
script.Parent.Parent.PlayerAssetsTip.MyAssets.Visible = false
local frame = script.Parent.Donate_Announcement.Major
local getID = game.Players:FindFirstChild(donator)
frame.Avatar_Icon.Image = "rbxthumb://type=Avatar&id=" .. getID.UserId .. "&w=150&h=150"
frame.Visible = true
frame.Amount.Text = getProductCost(assetId) .. " Robux"
frame.TextLabel.Text = donator .. " has donated to " .. recipient
frame:TweenPosition(UDim2.new(0, 0, 0, 0))
task.wait(4)
frame:TweenPosition(UDim2.new(1, 0, 0, 0))
task.wait(1)
frame.Visible = false
frame:TweenPosition(UDim2.new(-1, 0, 0, 0))
elseif announcement_type == "Minor" then
Snippet of my code, keep in mind I’ve debugged this and the “AssetId” parameter is a valid ID, it’s just for some reason I can’t get the robux cost of said ID.