How would I prompt a ugc item in game?

The title basically says it all.

1 Like

I believe you’d do the same for prompting purchases of T-Shirts, which I think is just a function called PromptPurchase under MarketplaceService.

I need exact code is the problem I dont know if that would work ive tryed it.

Go to the product (UGC) on the creator tab and set its universe to the games. Then use prompt purchase (Like subtotalAnt8185 said).

-- Script Must Be Called From Server!
-- // Declared Services

local MarketplaceService   = game:GetService("MarketplaceService");
local ReplicatedStorage    = game:GetService("ReplicatedStorage");
local Remotes              = ReplicatedStorage:WaitForChild("Remotes", 1)

-- // Private Declarations

local ProductId            = 123456789 -- Insert ID to attempt to purchase

Remotes.ClaimUGC.OnServerEvent:Connect(function(player : Player)
       if ProductId then -- Add checks to see if they can buy it
             MarketplaceService:PromptPurchase(player, ProductId) -- Prompt UGC to player
       end
end)

This is a rought estimate of how the script will look. Make sure to create a remotes folder inside of ReplicatedStorage and create a RemoteEvent inside of it called ClaimUGC

1 Like

Thank you! One last thing, How would I make it so they can try them on?

have the asset for the hat in the game then have a try on button that will clone the accessory onto the player,

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.