Tuesday, June 15, 2021

How to Make a Shop in Roblox Studio

This wikiHow teaches you how to create a basic shop in Roblox using a dialog script. Creating a dialog script is like writing a conversation between the merchant and the buyer.

[Edit]Steps

  1. Pick three weapons from "Weapons" in the toolbox. Your weapons appear in the "Workspace" branch in the explorer tree.
    6225468 1.jpg
  2. Drag the weapons into the "Replicated Storage" branch.
    6225468 2.jpg
  3. Rename the three weapons. To rename a weapon, right-click its name and type something unique (without spaces). Be descriptive!
    6225468 3.jpg
  4. Make an NPC. NPCs are commonly made from bricks, countertops, or boxes, although you are free to use whatever you wish. If you decide to use bricks, make sure you've anchored the bricks in place.
    6225468 4.jpg
  5. Select the three pieces of your NPC and rename them "NPC." To do this, drag the mouse to select all three pieces, right-click the selected area, and then click Group. Call the group "NPC."
    6225468 5.jpg
  6. Select the NPC's head from the right panel and click .
    6225468 6.jpg
  7. Insert a dialog. To do this, right-click Head and go to Insert > Object > dialog.
    6225468 7.jpg
  8. Change the "Purpose" property to "Shop." It's in the Properties section.
    6225468 8.jpg
  9. Type what you want your NPC to say. This goes into the initialprompt box.
    6225468 9.jpg
  10. Select the dialog in Explorer and go to > .
    6225468 10.jpg
  11. Select and change the UserDialog property value. Change it to something like, "May I browse your goods?"
    6225468 11.jpg
  12. Add a response and dialog choices. Set the ResponseDialog property to "Sure!" Then, insert three "DialogChoices" into the "DialogChoice" we just made. Rename them from their defaults and set their UserDialog properties to the names of the weapons.
    6225468 12.jpg
  13. Add a script into the dialog (not dialog choice). Now you can add the lua code for your script.[1]. It should read:
    6225468 13.jpg
  14. Save your game. Your store is now ready to use.
    6225468 14.jpg

[Edit]Tips

  • Don't copy and paste the script. Writing it will make it function properly.
  • If you're having problems, be sure to check carefully for typos!
  • Make sure your names are exactly the same as the ones specified. Use the same capital letters and spaces.
  • You can add a GUI which shows your balance of 'gold'. YouTube has plenty of tutorials for those.

[Edit]References



from How to of the Day https://ift.tt/2RV539Y

No comments:

Post a Comment