Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do I make a ShopGUI like the one in Robloxity?

I know how to use the text buttons, but I'm a bit confused on the scripting aspect on the shop. Can someone please help me?

1 answer

Well I'm not familiar with the game you talking about but a ShopGui is pretty simple.

Step 1: Insert Screen GUI into starter GUI -put a frame into it -resize the frame to the desired window size -insert text button into the frame

so once you make it look all pretty, put this script into the button

script.Parent.MouseButton1Down:connect(function() --[[doesn't need to be an anonymous function it can be a named one ]]--
	
local key=game.ServerStorage.Key:Clone()  --change "key to whatever the tool is"

local player=script.Parent.Parent.Parent.Parent.Parent	 --[[ this is assuming the button and main frame are the only objects you have in the GUI ]]--

local ls=player.leaderstats --change to the name of your leaderstats

local money=ls.money  --change to your money


if money.Value >=150 then    
	
money.Value=money.Value-150	 --change the 150's to the desired price
	


key.Parent=player.Backpack --change key to the tool you're giving to the player
	

end
end)

obviously change key to the desired tool and change money to where ever the money on your game is stored. This is very simple and basic shop GUI you can add features to see if the player already has the tool, you can make an output window stating the tool has been purchased, you can insert an image of the tool into the GUI, you can tween the GUI to open and close as a moving drop down box... The possibilities are endless

1 comment

0

Thanks! In the shop, is there any way I can put a car for sale. I built an exotic car and I'm willing to put it in the shop. Is that possible?

This discussion is preserved as it was. New answers, comments, and votes are closed.