RobloxScripterAI
Discord ↗
Link Copied to Clipboard
×
"write me a main menu script with gui, add comments to code telling me where to put it in studio"
-- local script, put this in the StarterGui of the player character local player = game.Players.LocalPlayer local screenGui = Instance.new("ScreenGui", player.PlayerGui) local mainFrame = Instance.new("Frame", screenGui) mainFrame.Name = "MainFrame" mainFrame.Size = UDim2.new(0.5, 0, 0.5, 0) mainFrame.Position = UDim2.new(0.25, 0, 0.25, 0) mainFrame.BackgroundTransparency = 0.5 mainFrame.BackgroundColor3 = Color3.fromRGB(255, 255, 255) local titleLabel = Instance.new("TextLabel", mainFrame) titleLabel.Name = "TitleLabel" titleLabel.Size = UDim2.new(1, 0, 0.2, 0) titleLabel.Position = UDim2.new(0, 0, 0, 0) titleLabel.BackgroundTransparency = 1 titleLabel.Text = "Main Menu" titleLabel.Font = Enum.Font.SourceSansBold titleLabel.FontSize = Enum.FontSize.Size48 titleLabel.TextColor3 = Color3.fromRGB(0, 0, 0) local playButton = Instance.new("TextButton", mainFrame) playButton.Name = "PlayButton" playButton.Size = UDim2.new(0.5, 0, 0.2, 0) playButton.Position = UDim2.new(0.25, 0, 0.3, 0) playButton.BackgroundTransparency = 0.5 playButton.BackgroundColor3 = Color3.fromRGB(255, 0, 0) playButton.Text = "Play" playButton.Font = Enum.Font.SourceSansBold playButton.FontSize = Enum.FontSize.Size24 playButton.TextColor3 = Color3.fromRGB(255, 255, 255) local exitButton = Instance.new("TextButton", mainFrame) exitButton.Name = "ExitButton" exitButton.Size = UDim2.new(0.5, 0, 0.2, 0) exitButton.Position = UDim2.new(0.25, 0, 0.5, 0) exitButton.BackgroundTransparency = 0.5 exitButton.BackgroundColor3 = Color3.fromRGB(255, 0, 0) exitButton.Text = "Exit" exitButton.Font = Enum.Font.SourceSansBold exitButton.FontSize = Enum.FontSize.Size24 exitButton.TextColor3 = Color3.fromRGB(255, 255, 255) playButton.MouseButton1Click:Connect(function() -- Code for when the player clicks the play button end) exitButton.MouseButton1Click:Connect(function() -- Code for when the player clicks the exit button end)