RobloxScripterAI
Discord ↗
Link Copied to Clipboard
×
"A full main menu with tweens"
-- local script (StarterGui) local player = game.Players.LocalPlayer local screenGui = Instance.new("ScreenGui", player.PlayerGui) local menuFrame = Instance.new("Frame", screenGui) menuFrame.Size = UDim2.new(0, 400, 0, 300) menuFrame.Position = UDim2.new(0.5, -200, 0.5, -150) menuFrame.BackgroundColor3 = Color3.fromRGB(0, 0, 0) menuFrame.BorderSizePixel = 0 local menuTitle = Instance.new("TextLabel", menuFrame) menuTitle.Text = "Main Menu" menuTitle.Font = Enum.Font.SourceSansBold menuTitle.TextSize = 36 menuTitle.TextColor3 = Color3.fromRGB(255, 255, 255) menuTitle.Position = UDim2.new(0.5, -menuTitle.TextBounds.X/2, 0.1, 0) local playButton = Instance.new("TextButton", menuFrame) playButton.Text = "Play" playButton.TextColor3 = Color3.fromRGB(255, 255, 255) playButton.BackgroundColor3 = Color3.fromRGB(0, 0, 0) playButton.Position = UDim2.new(0.5, -75, 0.4, 0) playButton.Size = UDim2.new(0, 150, 0, 50) playButton.UICorner = 5 local quitButton = Instance.new("TextButton", menuFrame) quitButton.Text = "Quit" quitButton.TextColor3 = Color3.fromRGB(255, 255, 255) quitButton.BackgroundColor3 = Color3.fromRGB(0, 0, 0) quitButton.Position = UDim2.new(0.5, -75, 0.6, 0) quitButton.Size = UDim2.new(0, 150, 0, 50) quitButton.UICorner = 5 local tweenService = game:GetService("TweenService") local menuTweenIn = tweenService:Create(menuFrame, TweenInfo.new(1, Enum.EasingStyle.Bounce, Enum.EasingDirection.Out), {Position = UDim2.new(0.5, -200, 0.5, -150)}) local menuTweenOut = tweenService:Create(menuFrame, TweenInfo.new(1, Enum.EasingStyle.Bounce, Enum.EasingDirection.Out), {Position = UDim2.new(0.5, -200, 1.5, -150)}) playButton.MouseButton1Click:Connect(function() menuTweenOut:Play() -- insert code for starting game here end) quitButton.MouseButton1Click:Connect(function() menuTweenOut:Play() -- insert code for quitting game here end) menuTweenIn:Play()