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.
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)
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
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:
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.
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:
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!