Buy model Support

Okay so I have a quick and simple question, what if you wanted a Player to press/click a certain part to “buy” a model for free? Similar to a game pass, but with models instead. I’ve seen others successfully counter this and I’d like to try it myself to advertise my models within my development.
image_2024-01-14_041244644
Model by Asadrith

I tried using those Click to Buy Gamepass scripts via Studio’s Toolbox but instead of putting in a game pass assets ID, I tried putting in one of my model’s assets ID.

I know this seems very incorrect of me but as I said before, it was worth a try. Now then, does anybody know how to execute this fine idea?

I’m not too familiar with the MarketplaceService, however, you should implement a check to see whether a player already owns the asset; in your case, since you are the creator of the asset, then by default you already own the asset and therefore, you don’t receive the purchase prompt.

MarketplaceService:PlayerOwnsAsset(player, assetid)

If the user (you, for example) already owns the asset, then you can simply print a message, so you can confirm that the system works.

You can find out more information about :PlayerOwnsAsset here:

1 Like

I tried looking into the link you sent me, which was very appreciated. But I don’t think I found anything useful in my eyes to my situation. Thanks for trying to help though :+1:

I found the solution! For anybody else wondering, I had to use

local MarketplaceService = game:GetService("MarketplaceService")
local Players = game:GetService("Players")

local model = script.Parent
local assetId = 15981199675

along with a touch part.

1 Like

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