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...
Step-by-Step Guide
-
Step 1: Get three weapons from 'weapons' in toolbox.
-
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. ,, -
Step 3: look under the Workspace branch for your weapons.
-
Step 4: Rename the three weapons by right-clicking and selecting "Rename."
-
Step 5: Make an NPC.
-
Step 6: After you have built your NPC
-
Step 7: in the workspace
-
Step 8: drag your mouse so that all of the pieces of your NPC are selected.
-
Step 9: Select the NPC's head from the right side and click once on the name "Head."
-
Step 10: Add a script into the dialog
-
Step 11: not dialog choice
-
Step 12: which should read: local dialog = script.Parentdialog.DialogChoiceSelected:connect(function(player
-
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)
-
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
Doris Turner
Professional writer focused on creating easy-to-follow lifestyle tutorials.
Rate This Guide
How helpful was this guide? Click to rate: