Elixio's Main Menu UI

Try this:

-- Let's Define a Few Important Variables first!
local button = script.Parent -- We define our button, which is a child to this script.
local description = button:WaitForChild("Description") -- Get's the description thats inside the button.
local tweenService = game:GetService("TweenService") -- This allows us to do smooth animations!
local tweenInfo = TweenInfo.new(0.35, Enum.EasingStyle.Quad) -- This is the info for our tweens. The first Int is the duration of time (in seconds) it takes to finish a tween and the second Value is the EasingStyle. You can play around with both and see if you find something you like!


-- Now Let's program the button!
button.MouseEnter:Connect(function() -- The code inside this function occurs whenever the players mouse is over the button. Let's make some nice animations.
	tweenService:Create(description, tweenInfo, {TextTransparency = 0}):Play() -- Makes the description text visible.
	button:TweenSize(UDim2.new(0.209, 0, 0.057, 0), Enum.EasingDirection.InOut, Enum.EasingStyle.Quad, 0.1, true) -- tweens the size of the button and makes it bigger
end)

button.MouseLeave:Connect(function() -- The code inside this function occurs whenever the players mouse is over the button, but then leaves.
	tweenService:Create(description, tweenInfo, {TextTransparency = 1}):Play() -- Makes the description text invisible.
	button:TweenSize(UDim2.new(0.202, 0, 0.051, 0), Enum.EasingDirection.InOut, Enum.EasingStyle.Quad, 0.1, true) -- tweens the size of the button and makes it the base size of what it was
end)

button.MouseButton1Click:Connect(function() -- The code inside this function occurs whenever the player clicks the button.
	local clickSFX = script.Parent.Parent.Click
	-- clickSFX:Play() -- OPTIONAL, UNCOMMENT IF YOU WANT A SOUND TO PLAY WHEN THE PLAYER CLICKS THE BUTTON.
	local CurrentCamera = workspace.CurrentCamera
CurrentCamera.CameraType = Enum.CameraType.Custom
	workspace.CurrentCamera.CameraSubject = game.Players.LocalPlayer.Character.Humanoid
    workspace.CurrentCamera.CFrame = game.Players.LocalPlayer.Character.Head.CFrame
	
end)

doesnt work.
image

2 Likes

This menu is awesome! I could create smth else with it like shown in the vid, I will prob make it a bit better and detailed in the future, but I’m happy with the result, nice resource!

7 Likes

Oh my god, I was just looking through the thread and I didn’t expect to see my LocationTitle module. Very cool to see the implementation! You should probably change it so it plays after the intro sequence and everything.

4 Likes

Yeah, I’m actually going to use it for some projects that I have, since it is much better than my old system, and it looks fancier, but sure, I will do your suggestion for sure!

1 Like

This is my take at it.

4 Likes


I can’t seem to find the problem here, I kept on checking the output but still can’t figure the problem out. It used to work but now it doesn’t.

try :WaitForChild(workspace.campart)


Still nothing. I don’t really have much knowledge in scripting, is this right? If then, what line?

undo whatever you just did and change line 3 to:
local camPart = workspace:WaitForChild("campart")

Very good, like the detail within it too!

Could I add some cool music to the main menu? If yes then could anyone help me out on what should I do? Thank you!

You could add a boolean that checks for whenever the player’s in the main menu. Call it isInMainMenu or something. While they’re in the main menu, set it to true then have a while loop run while it’s true. Then you could load your music in before the script.

local MainMenuMusic = (location of music here) -- Put in a WaitForChild here
local isInMainMenu = false 
-- insert gui code here
isInMainMenu = true 
while isInMainMenu do
   MainMenuMusic:Play()
end

Then when the player exits, set the boolean to false. Then the while loop (hopefully) will end.

do I insert your script into “TitleSceenHandler” ?
image

Yeah it should work when put into there

Hello, i checked your problem and it is the solution;
you can paste this script

-- Let's Define a Few Important Variables first!
local button = script.Parent -- We define our button, which is a child to this script.
local description = button:WaitForChild("Description") -- Get's the description thats inside the button.
local tweenService = game:GetService("TweenService") -- This allows us to do smooth animations!
local tweenInfo = TweenInfo.new(0.35, Enum.EasingStyle.Quad) -- This is the info for our tweens. The first Int is the duration of time (in seconds) it takes to finish a tween and the second Value is the EasingStyle. You can play around with both and see if you find something you like!


-- Now Let's program the button!
button.MouseEnter:Connect(function() -- The code inside this function occurs whenever the players mouse is over the button. Let's make some nice animations.
	tweenService:Create(description, tweenInfo, {TextTransparency = 0}):Play() -- Makes the description text visible.
	button:TweenSize(UDim2.new(0.209, 0, 0.057, 0), Enum.EasingDirection.InOut, Enum.EasingStyle.Quad, 0.1, true) -- tweens the size of the button and makes it bigger
end)

button.MouseLeave:Connect(function() -- The code inside this function occurs whenever the players mouse is over the button, but then leaves.
	tweenService:Create(description, tweenInfo, {TextTransparency = 1}):Play() -- Makes the description text invisible.
	button:TweenSize(UDim2.new(0.202, 0, 0.051, 0), Enum.EasingDirection.InOut, Enum.EasingStyle.Quad, 0.1, true) -- tweens the size of the button and makes it the base size of what it was
end)

button.MouseButton1Click:Connect(function() -- The code inside this function occurs whenever the player clicks the button.
	local clickSFX = script.Parent.Parent.Click
	-- clickSFX:Play() -- OPTIONAL, UNCOMMENT IF YOU WANT A SOUND TO PLAY WHEN THE PLAYER CLICKS THE BUTTON.
	local CurrentCamera = workspace.CurrentCamera
CurrentCamera.CameraType = Enum.CameraType.Custom
	workspace.CurrentCamera.CameraSubject = game.Players.LocalPlayer.Character.Humanoid
    workspace.CurrentCamera.CFrame = game.Players.LocalPlayer.Character.Head.CFrame

-- This is the solution
script.Parent.Parent.Parent.CameraMovement.Enabled = false
	
end)

at the end, you must disable the CameraMovement script.

1 Like