How to make a basic shop GUI

WARNING! Requirements include how to publish your game, accessibility to the website, and how to add things. (Example, a part into workspace.)

Hello! I’m going to teach you a basic scripting/GUI tutorial with making a Shop GUI!

1: Add the UI’s.
First, lets add a ScreenGUI in the StarterGUI.
then, lets add a TextButton and name it “Open”.
then, Add A frame and name it Shopframe.
so trueueueueueeeeeeeeeetutorial

it should look like this when your done!

2:
put a local script in your open button, and type the following inside:

script.Parent.MouseButton1Click:Connect(function()   
script.Parent.Parent.Shopframe.Visible = true  
end)

tutorial2222222222

3: Customize your shop!

This is the fun part of this, as you choose what you get to add.

If you want to customize on your own without any example, skip this:

Example Pictures

okkkk
okkkkkaaaaaaa

4: Adding a close button.
Added a text button inside of your frame, and name it: “Close”
Next, add a local script and write the following:

script.Parent.MouseButton1Click:Connect(function() 
script.Parent.Parent.Visible = false  print("UI Closed") 
end)

This will now close the frame!

5: Finishing up.
Make the shopframe not visible.
test your game, it should open when you press shop, and close when you press close!

Congrats, you finished the tutorial. Please leave a like if this helped you.
Finished UI:

finished result

Next step coming: UI tips and tricks!

ShopUI Level 2

Adding Products

So now that we have our shop, lets give players something to actullay buy!

So first, we need a devproduct. A devproduct is basically an option to buy something.

For this, were going to use devproduct AND a gamepass.

1: Adding the devproduct.
Publish your game. (File - Publish to Roblox.)
Go to the Create tab on the roblox website, and press the config button next to your game.
config
next, once you have, click Configure PLACE, Not experience, PLACE!.
Then, click developer products on the left side of the screen.
Once you have, click “Create New”.
Set a name, description(optional) and price in robux. then click create.
Now you have the devproduct.
Now, copy the ID that goes with the product. (Should be under something that says id)
Then go into your game, and enter a textbutton into the shopframe.
Add a local script in the textbutton, and enter the following, and replace REPLACETHISWITHIDPLEASE with the devproduct id.

local id = REPLACETHISWITHIDPLEASE
script.Parent.MouseButton1Click:Connect(function() 
	game:GetService("MarketplaceService"):PromptProductPurchase(game.Players.LocalPlayer, id)
end) 



Then, go ahead and test your game. When you click the button, you should see something like this:
DevProductPopUp
You now can get somebody to buy something! I reccomend replacing this with a gamepass (Create - Config - Create Pass) so it will save.

And there you have it! Now you have a fully working shop system!

14 Likes

I’d probably change the title to a open-close gui instead, since
this has nothing to do with a shop.

If you want to make it into a shop GUI tutorial, you might wanna actually give it shop functionality like gamepasses, devproducts, etc.

3 Likes

Thanks, i agree. Ill add an option for more things like devproducts, etc.

3 Likes

Considering it’s a basic UI, it looks decent and good.

1 Like

Updated tutorial to level 2. This goes over the buying part of the shop. Ill update it more later, thanks for all the feedback so far.

1 Like