I made something exactly like this a while back. I just copy and pasted the script that I created, so maybe you can break it down to figure it out? Here it is:
01 | local Menu = script.Parent.Parent:WaitForChild( "Menu" ) |
02 | local open = game.StarterGui.MenuGUI.Menu.Open.Value |
03 | local Codes = script.Parent.Parent:WaitForChild( "CodesMenu" ) |
04 | local CashMenu = script.Parent.Parent:WaitForChild( "CashMenu" ) |
05 | local CashItems = script.Parent.Parent:WaitForChild( "CashItems" ) |
06 | local ShopMenu = script.Parent.Parent:WaitForChild( "ShopMenu" ) |
07 | local Particles = script.Parent.Parent:WaitForChild( "Particles" ) |
08 | local Items = script.Parent.Parent:WaitForChild( "Items" ) |
10 | script.Parent.MouseButton 1 Click:connect( function () |
11 | if enabled = = true then |
14 | Menu:TweenPosition(UDim 2. new( 0 , 0 , 0 , 300 ), "Out" , "Quint" , 0.5 ) |
16 | script.Parent.Text = "Menu" |
17 | elseif open = = true then |
18 | Menu:TweenPosition(UDim 2. new(- 1 , 0 , 0 , 300 ), "In" , "Quint" , 0.5 ) |
19 | Codes:TweenPosition(UDim 2. new( 1.272 , 0 , 0.203 , 0 ), "In" , "Quint" , 0.5 ) |
20 | CashMenu:TweenPosition(UDim 2. new( 1.272 , 0 , 0.203 , 0 ), "In" , "Quint" , 0.5 ) |
21 | CashItems:TweenPosition(UDim 2. new( 1.272 , 0 , 0.203 , 0 ), "In" , "Quint" , 0.5 ) |
22 | ShopMenu:TweenPosition(UDim 2. new( 1.272 , 0 , 0.203 , 0 ), "In" , "Quint" , 0.5 ) |
24 | Particles.Visible = false |
25 | ShopMenu.Particles.Text = "Particles" |
26 | ShopMenu.Power.Text = "Power Ups" |
29 | script.Parent.Text = "Menu" |
Sorry if it looks kind of messy, I'm not a very good scripter yet. I hope you can get something from this though!