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:
local Menu = script.Parent.Parent:WaitForChild("Menu")
local open = game.StarterGui.MenuGUI.Menu.Open.Value
local Codes = script.Parent.Parent:WaitForChild("CodesMenu")
local CashMenu = script.Parent.Parent:WaitForChild("CashMenu")
local CashItems = script.Parent.Parent:WaitForChild("CashItems")
local ShopMenu = script.Parent.Parent:WaitForChild("ShopMenu")
local Particles = script.Parent.Parent:WaitForChild("Particles")
local Items = script.Parent.Parent:WaitForChild("Items")
enabled = true
script.Parent.MouseButton1Click:connect(function()
if enabled == true then
enabled = false
if open == false then
Menu:TweenPosition(UDim2.new(0, 0,0, 300),"Out","Quint", 0.5)
open = true
script.Parent.Text = "Menu"
elseif open == true then
Menu:TweenPosition(UDim2.new(-1, 0,0, 300),"In","Quint", 0.5)
Codes:TweenPosition(UDim2.new(1.272, 0,0.203, 0),"In","Quint", 0.5)
CashMenu:TweenPosition(UDim2.new(1.272, 0,0.203, 0),"In","Quint", 0.5)
CashItems:TweenPosition(UDim2.new(1.272, 0,0.203, 0),"In","Quint", 0.5)
ShopMenu:TweenPosition(UDim2.new(1.272, 0,0.203, 0),"In","Quint", 0.5)
Items.Visible = false
Particles.Visible = false
ShopMenu.Particles.Text = "Particles"
ShopMenu.Power.Text = "Power Ups"
open = false
script.Parent.Text = "Menu"
end
end
wait(1)
enabled = true
end)
Sorry if it looks kind of messy, I'm not a very good scripter yet. I hope you can get something from this though!
4 comments
Oops I guess I didnt refresh it to find out if someone else answered D:
It's fine, now he/she has two answer they can learn from
sheepposu you need to add a number at the end EX: (UDim2.new(0, 2, 0, 0.2, 0), 'Out', 'Quint', ANumberHere)
No, I do it without the number. The default is already 1