While wait(0.1) do - Every 0.1 seconds, it removes 1 from the current value of 24 in the blur. Once we close the menu, we want to remove the blur slowly. If blur.Size = 24 then - Here, we are changing the value of the blur effect. Local tween2 = TweenService:Create(frame2, tweenInfo, goal) - Making tween2 Local tween1 = TweenService:Create(frame1, tweenInfo, goal) - Making tween1 Local tweenInfo = TweenInfo.new(2,, ) - Again, these are the tween settings, which you can change however you'd like. You can change it to whatever position you'd like. Goal.Position = UDim2.new(1,0,0,0) - This is where we want it to go. If db = false then - Checks if debounce is off We want to make sure it's closed before trying to close it.again. If = false then - This checks if the "closed" value is false. Local blur = - The blur we added before making this scriptĪwesome! Now, we can go ahead and add our code! I added a few notes in the code to help explain what each line means! 1Click:Connect(function() Local frame2 = player.PlayerGui:WaitForChild("MainMenu").BackGroundFrame Local frame1 = player.PlayerGui:WaitForChild("MainMenu").Frame Local player = - The local player as we want this to be local Lets define our variables: local TweenService = game:GetService("TweenService") So let us start by scripting the play buttons! We’ll be using Robloxs’ TweenService for this! The BoolValue we created earlier will sure help us now!īefore we move on, go to Lighting and add a BlurEffect. You completed making your menu! Phew that was a lot! Let us start scripting it. Customize it and set its visibility to false. This is the button that will open the menu if it’s closed. Add a TextButton inside of the ScreenGui and name it, “OpenMenu”.I added a gradient in my title to make it look more appealing! Add a title and a subtitle if you wish.Add all of the settings within it then make its visibility false for now. This will be the frame with all of the user settings. Clone the “Credits” frame and name that frame, “SettingsFrame”.This is where you can add credits, or just general information that you want your players to know about before entering your game. Add a frame within the menu frame and name it, “Credits”.I made 2 image buttons and 2 text buttons. Make the size of the frame 1,0,1,0 and customize if however you’d like! I added a “DropStyle” style to mine! Add a frame and keep it called, “Frame”.I suggest having the background a tiny bit transparent (0.2) to help add a blur effect later. Make the size of the background frame 1,0,1,0 (full size). You can style it HOWEVER you’d like! Remember, this is the background, not the menu. | Add a frame inside of the MainMenu and name it, “BackgroundFrame”. Ignore if you DON’T want a background in your menu.This will be used later when scripting the menu! Add a BoolValue inside of the ScreenGui and name it, “Closed”.If this is disabled, you will see a bar on the top of the screen which will cut the menu off. This way, the menu will fit on the entire screen. Insert a ScreenGui inside of StarterGui.Settings, tweens and chat will all be local, so other players can’t see it. When making the GUI, you must be mindful that it’s local. When sizing your frames, buttons and labels, YOU NEED TO SIZE THEM BY SCALE, NOT OFFSET! Sizing by the scale makes sure the UI will fit on all devices.IF YOU WISH TO SKIP THE TUTORIAL, THERE IS A MODEL BELOW THAT IS ALREADY MADE! YOU CAN USE THAT!
0 Comments
Leave a Reply. |