How can I make an inventory shop like this?

Hi! While looking at some other obby games, I noticed that they implemented shops found in the inventory. When you click on an item, it’ll prompt you to purchase that chosen gamepass.

Screenshot 2025-02-02 at 9.09.27 AM

How could this be added to a game? There weren’t any other devforum posts talking about this, and it’s a bit confusing where to store the ui. Thanks!

1 Like

So you would just detect when they try to equip it with Tool.Equipped

here’s those docs

and then make your GUI, make it invisible, and place it in StarterGui (you have to make it there to visualize it so it should already be there).

Finally, in the Tool.Equipped event, just change the GUI to be visible.

(im not sure if you’re talking about the Roblox Buy Prompt gui or having your own custom one since ive seen both in a bunch of games)

2 Likes

Would that mean I replicate the item in the players’ inventory? Because there could be some problems with players being confused between their purchased item and the other. And also, the other games don’t have the player “equip” the item, instead it’s just shown in the inventory section.

1 Like

Well no you don’t have to cause in the Tool.Equipped event you can just make it so that there’s an if statement that checks whether or not they bought it yet

local Tool = path.to.tool

Tool.Equipped:Connect(function()
   --[[ logic for if they
   own the tool
   (too long to write here)
   ]]
   if not ownstool then
      --[[ doesn’t own the tool
      so prompt them to purchase
      ]]
   end
end)

Yeah I understand what you mean, but yeah when you give the player the item and the click the icon, that counts as “equipping it”

Thanks! It makes a lot more sense now!

1 Like