How to Make a Shop in Roblox Studio

Get three weapons from 'weapons' in toolbox., In the explorer tree view, look under the Workspace branch for your weapons., Rename the three weapons by right-clicking and selecting "Rename.", Make an NPC., After you have built your NPC, in the...

14 Steps 1 min read Advanced

Step-by-Step Guide

  1. Step 1: Get three weapons from 'weapons' in toolbox.

     
  2. Step 2: In the explorer tree view

    Drag them into the "Replicated Storage" branch. , Name them something unique but descriptive.

    Be sure not to use spaces in your names or else you will have difficulty later., NPCs are commonly made from bricks, counter tops, or boxes, although you are free to use whatever you wish to.

    If you decide to use bricks, make sure you've anchored the bricks in place., Right click it and click group.

    Name the group "NPC."

    From here, right-click it and go to insert > object > dialog.

    In properties, change the purpose property to shop.

    Write in the initialprompt box what you want your NPC to say.

    While your Dialog is still selected in Explorer, go to Insert > Object > DialogChoice.

    In the properties window, change the UserDialog property value to "May I browse your goods?" and the ResponseDialog property to "Sure!" Insert three DialogChoices into the DialogChoice we just made.

    So your hierarchy should now look like this:
    Rename them from their defaults and set their UserDialog property to the names of the weapons. ,,
  3. Step 3: look under the Workspace branch for your weapons.

  4. Step 4: Rename the three weapons by right-clicking and selecting "Rename."

  5. Step 5: Make an NPC.

  6. Step 6: After you have built your NPC

  7. Step 7: in the workspace

  8. Step 8: drag your mouse so that all of the pieces of your NPC are selected.

  9. Step 9: Select the NPC's head from the right side and click once on the name "Head."

  10. Step 10: Add a script into the dialog

  11. Step 11: not dialog choice

  12. Step 12: which should read: local dialog = script.Parentdialog.DialogChoiceSelected:connect(function(player

  13. Step 13: choice) -- Check the player has a stats object local stats = player:FindFirstChild('leaderstats') if not stats then return end -- And that the stats object contains a gold member local gold = stats:FindFirstChild('Gold') if not gold then return end if choice == script.Parent.DialogChoice.ChoiceA then if gold.Value >= 5 then -- 5 is the amount of gold you need to purchase this weapon game.ReplicatedStorage.Weapon1:Clone().Parent = player.Backpack gold.Value = gold.Value - 5 -- subtract the amount of gold you need to purchase end elseif choice == dialog.DialogChoice.ChoiceB then if gold.Value >= 10 then game.ReplicatedStorage.Weapon2:Clone().Parent = player.Backpack gold.Value = gold.Value - 10 end elseif choice == dialog.DialogChoice.ChoiceC then if gold.Value >= 15 then game.ReplicatedStorage.Weapon3:Clone().Parent = player.Backpack gold.Value = gold.Value - 15 end end end)

  14. Step 14: Save your game.

Detailed Guide

 

Drag them into the "Replicated Storage" branch. , Name them something unique but descriptive.

Be sure not to use spaces in your names or else you will have difficulty later., NPCs are commonly made from bricks, counter tops, or boxes, although you are free to use whatever you wish to.

If you decide to use bricks, make sure you've anchored the bricks in place., Right click it and click group.

Name the group "NPC."

From here, right-click it and go to insert > object > dialog.

In properties, change the purpose property to shop.

Write in the initialprompt box what you want your NPC to say.

While your Dialog is still selected in Explorer, go to Insert > Object > DialogChoice.

In the properties window, change the UserDialog property value to "May I browse your goods?" and the ResponseDialog property to "Sure!" Insert three DialogChoices into the DialogChoice we just made.

So your hierarchy should now look like this:
Rename them from their defaults and set their UserDialog property to the names of the weapons. ,,

About the Author

D

Doris Turner

Professional writer focused on creating easy-to-follow lifestyle tutorials.

100 articles
View all articles

Rate This Guide

--
Loading...
5
0
4
0
3
0
2
0
1
0

How helpful was this guide? Click to rate: