PDF download Download Article PDF download Download Article

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.

  1. Your weapons appear in the "Workspace" branch in the explorer tree.
  2. Advertisement
  3. To rename a weapon, right-click its name and type something unique (without spaces). Be descriptive!
  4. 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.
  5. To do this, drag the mouse to select all three pieces, right-click the selected area, and then click Group. Call the group "NPC."
  6. To do this, right-click Head and go to Insert > Object > dialog.
  7. It's in the Properties section.
  8. This goes into the initialprompt box.
  9. Change it to something like, "May I browse your goods?"
  10. 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.
  11. Now you can add the lua code for your script.[1] . It should read:
    local dialog = script.Parent.DialogChoiceSelected:connect(function(player, 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)
    
  12. Your store is now ready to use.
  13. Advertisement

Community Q&A

Search
Add New Question
  • Question
    How do I use the complicated code in Roblox Studio?
    Community Answer
    Community Answer
    Copy and paste what is says above, However, make sure that you paste it in the right place our else it will not work.
  • Question
    Does a shop have to have clothing?
    BlobbieNado
    BlobbieNado
    Community Answer
    No, your shop does not have to have clothing. Your shop can be whatever you want to! Just note, some users may want to see clothing and others may not.
  • Question
    Were do you put the items?
    Community Answer
    Community Answer
    You can always build your own items, or use the toolbar to find one you like and place them wherever you want in your shop.
See more answers
Ask a Question
200 characters left
Include your email address to get a message when this question is answered.
Submit
Advertisement

Tips

Show More Tips
Submit a Tip
All tip submissions are carefully reviewed before being published
Name
Please provide your name and last initial
Thanks for submitting a tip for review!
Advertisement

You Might Also Like

Roblox Display Names Ideas150+ Funny, Cool, & Creative Roblox Display Name Ideas
Get Robux for Your Roblox Account Get Robux for Your Roblox Account
Give Someone Robux Give Someone Robux: 4 Easy Methods & Workarounds
Play Roblox on a School ChromebookHow To Download and Play Roblox on a School Chromebook
Legendary Sword DealerComplete Guide to Finding the Blox Fruits Legendary Sword Dealer
Contact RobloxContact Roblox
Get Voice Chat on Roblox4 Simple Ways to Get Chat with Voice on Roblox
Flower Locations in Blox FruitsRed, Blue, and Yellow Flowers: Where & How to Find Them in Blox Fruits
Get Soul Guitar Blox FruitsSimple Ways to Get the Soul Guitar in Blox Fruits
Dough Fruit Get, Awaken, and Use the Dough Fruit in Blox Fruits: Pro Guide
Get V4Blox Fruits: Complete Guide to Unlocking and Maximizing Race V4
Roblox Error Code 2797 Simple Ways to Fix Roblox Disconnect Error Code 279
Update Roblox3 Simple Ways to Update Roblox + Troubleshooting Tips
Get True Triple KatanaThe Best Way to Get the True Triple Katana in Blox Fruits
Advertisement

About This Article

Nicole Levine, MFA
Written by:
wikiHow Technology Writer
This article was co-authored by wikiHow staff writer, Nicole Levine, MFA. Nicole Levine is a Technology Writer and Editor for wikiHow. She has more than 20 years of experience creating technical documentation and leading support teams at major web hosting and software companies. Nicole also holds an MFA in Creative Writing from Portland State University and teaches composition, fiction-writing, and zine-making at various institutions. This article has been viewed 68,228 times.
38 votes - 44%
Co-authors: 22
Updated: July 30, 2024
Views: 68,228
Categories: Featured Articles | Roblox
Thanks to all authors for creating a page that has been read 68,228 times.

Did this article help you?

Advertisement