-- 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)
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!
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.
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!
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.
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.
Does anyone know how I would script the New Game to get rid of the GUI and force them into first person? I’ve tried by looking at other scripts but I have no experience
button.MouseButton1Click:Connect(function() -- The code inside this function occurs whenever the player clicks the button.
local clickSFX = script.Parent.Parent.Click
local plr = game.Players.LocalPlayer
local start = game.StarterPlayer
local Players = game:GetService("Players")
local player = Players.LocalPlayer
start.CameraMaxZoomDistance = 0.5
player.CameraMode = Enum.CameraMode.LockFirstPerson
script.Parent.Parent.Parent.CameraMovement:Destroy()
workspace.campart:Destroy()
workspace.CurrentCamera:Destroy()
script.Parent.Parent:Destroy()
-- clickSFX:Play() -- OPTIONAL, UNCOMMENT IF YOU WANT A SOUND TO PLAY WHEN THE PLAYER CLICKS THE BUTTON.
-- YOUR CODE HERE --
end)