This is the code for a semi-intermediate gui:
local screen = script.Parent.Screen
local creditsMenu = script.Parent.CreditsMenu
local playButton = script.Parent.Screen.Play
local creditsButton = script.Parent.Screen.Credits
local closeCredits = script.Parent.CreditsMenu.CloseCredits
local openGui = script.Parent.OpenGui
local pop = game.Workspace.pop
playButton.MouseEnter:Connect(function()
playButton:TweenSize(UDim2.new(0, 210,0, 60), "Out", "Quad", 0.01, true)
end)
playButton.MouseLeave:Connect(function()
playButton:TweenSize(UDim2.new(0, 200,0, 50),"In", "Quad", 0.01,true)
end)
creditsButton.MouseEnter:Connect(function()
creditsButton:TweenSize(UDim2.new(0, 210,0, 60), "Out", "Quad", 0.01, true)
end)
creditsButton.MouseLeave:Connect(function()
creditsButton:TweenSize(UDim2.new(0, 200,0, 50),"In", "Quad", 0.01,true)
end)
playButton.MouseButton1Click:Connect(function()
screen:TweenPosition(UDim2.new(0, 0,1, 0), "Out", "Quad", 0.5, true)
openGui:TweenPosition(UDim2.new(0.011, 0,0.444, 0), "In", "Quad", 1, true)
pop:Play()
end)
creditsButton.MouseButton1Click:Connect(function()
creditsMenu:TweenPosition(UDim2.new(0.499, 0,0.5, 0), "In", "Quad", 0.5, true)
screen:TweenPosition(UDim2.new(0, 0,1, 0), "Out", "Quad", 0.5, true)
pop:Play()
end)
closeCredits.MouseButton1Click:Connect(function()
creditsMenu:TweenPosition(UDim2.new(0.499, 0,1.5, 0), "Out", "Quad", 0.5, true)
screen:TweenPosition(UDim2.new(0, 0,0, 0), "In", "Quad", 0.5, true)
pop:Play()
end)
closeCredits.MouseEnter:Connect(function()
closeCredits.TextColor3 = Color3.fromRGB(255,0,0)
end)
closeCredits.MouseLeave:Connect(function()
closeCredits.TextColor3 = Color3.fromRGB(255,255,255)
end)
openGui.MouseButton1Click:Connect(function()
screen:TweenPosition(UDim2.new(0, 0,0, 0), "Out", "Quad", 0.5, true)
openGui:TweenPosition(UDim2.new(-0.2, 0,0.444, 0), "Out", "Quad", 1, true)
pop:Play()
end)
openGui.MouseEnter:Connect(function()
openGui:TweenSize(UDim2.new(0, 131,0, 60), "Out", "Quad", 0.01, true)
end)
openGui.MouseLeave:Connect(function()
openGui:TweenSize(UDim2.new(0, 111,0, 50), "In", "Quad", 0.01, true)
end)
Its quite long for something so simple but i only put spaces in between each event.
I put spaces because its super difficult to read without, it looks like this with no spaces:
local screen = script.Parent.Screen
local creditsMenu = script.Parent.CreditsMenu
local playButton = script.Parent.Screen.Play
local creditsButton = script.Parent.Screen.Credits
local closeCredits = script.Parent.CreditsMenu.CloseCredits
local openGui = script.Parent.OpenGui
local pop = game.Workspace.pop
playButton.MouseEnter:Connect(function()
playButton:TweenSize(UDim2.new(0, 210,0, 60), "Out", "Quad", 0.01, true)
end)
playButton.MouseLeave:Connect(function()
playButton:TweenSize(UDim2.new(0, 200,0, 50),"In", "Quad", 0.01,true)
end)
creditsButton.MouseEnter:Connect(function()
creditsButton:TweenSize(UDim2.new(0, 210,0, 60), "Out", "Quad", 0.01, true)
end)
creditsButton.MouseLeave:Connect(function()
creditsButton:TweenSize(UDim2.new(0, 200,0, 50),"In", "Quad", 0.01,true)
end)
playButton.MouseButton1Click:Connect(function()
screen:TweenPosition(UDim2.new(0, 0,1, 0), "Out", "Quad", 0.5, true)
openGui:TweenPosition(UDim2.new(0.011, 0,0.444, 0), "In", "Quad", 1, true)
pop:Play()
end)
creditsButton.MouseButton1Click:Connect(function()
creditsMenu:TweenPosition(UDim2.new(0.499, 0,0.5, 0), "In", "Quad", 0.5, true)
screen:TweenPosition(UDim2.new(0, 0,1, 0), "Out", "Quad", 0.5, true)
pop:Play()
end)
closeCredits.MouseButton1Click:Connect(function()
creditsMenu:TweenPosition(UDim2.new(0.499, 0,1.5, 0), "Out", "Quad", 0.5, true)
screen:TweenPosition(UDim2.new(0, 0,0, 0), "In", "Quad", 0.5, true)
pop:Play()
end)
closeCredits.MouseEnter:Connect(function()
closeCredits.TextColor3 = Color3.fromRGB(255,0,0)
end)
closeCredits.MouseLeave:Connect(function()
closeCredits.TextColor3 = Color3.fromRGB(255,255,255)
end)
openGui.MouseButton1Click:Connect(function()
screen:TweenPosition(UDim2.new(0, 0,0, 0), "Out", "Quad", 0.5, true)
openGui:TweenPosition(UDim2.new(-0.2, 0,0.444, 0), "Out", "Quad", 1, true)
pop:Play()end)
openGui.MouseEnter:Connect(function()
openGui:TweenSize(UDim2.new(0, 131,0, 60), "Out", "Quad", 0.01, true)
end)
openGui.MouseLeave:Connect(function()
openGui:TweenSize(UDim2.new(0, 111,0, 50), "In", "Quad", 0.01, true)
end)