Making a menu gui appear after loading screen

also use connections so you can disconnect it so that it doesnt happen anymore

2 Likes

all of them would work dont worry

i could show you an example real quick

3 Likes

Ok but what would be the best way to combine the scripts changing those varibles is gonna be the most annoying thing

1 Like

another way is you could use bindable events to fire when the loading finishes then make the menu appear

2 Likes

Im a beginner scripter so i have no idea what a bindable event even is

1 Like

so basically a bindable is like a remote event which lets two scripts communicate so in your case you should fire a bindable in the end of loading script then you should do your menu script when you receive a bindable

--firing a bindable
bindableevent:Fire(parameter)
--receiving event
bindableevent.Event:Connect(function(params)
   --do something
end)

in your case would be

--loading script
--do your loading here
-finish loading
bindableevent:Fire()

–menu script
bindableevent.Event:Connect(function()
–show menu here
end)

2 Likes

So your saying before the loading screen script destroys itself fire a bindable event that tweens the menu gui?

1 Like

yes exactly i guess that what you mean

2 Likes

ill send you an example i made

2 Likes

here is an example @spydercam500

2 Likes

Wait where is the event suspose to be located?

1 Like

the event in the starter gui itself

2 Likes

It says 22:15:25.230 MenuEvent is not a valid member of PlayerGui β€œPlayers.spydercam500.PlayerGui” - Client - GuiScript:12

1 Like

could you show your script? cuz i can edit it

2 Likes

Menu script:

		local camera = game.Workspace.CurrentCamera


			function updateCamera()
				camera.CFrame = game.Workspace:WaitForChild("MenuCamera").CFrame --Makes the camera go to the camera brick
			end
			game:GetService("RunService").RenderStepped:Connect(updateCamera)
		script.Parent.Parent.MenuEvent.Event:Connect(function()
			
			
				local player  = game.Players.LocalPlayer
			local character = player.CharacterAdded
			local mouse = player:GetMouse()
			local defaultcframe = camera.CFrame
			local view = 150
			local blur = game.Lighting.Blur
			local settingsbutton = script.Parent.Settings
			local credits = script.Parent.Credits
			local play = script.Parent.Play
			local title = script.Parent.Title
			local logo = script.Parent.Logo
			local frame = script.Parent.FrameForButtons
			local creditsframe = script.Parent.CreditsFrame
			local settingsframe = script.Parent.SettingsFrame

			blur.Size = 5 --Makes the blur higher--





			script.Parent.Play.MouseButton1Click:Connect(function() --When the player clicks the play button--
				wait(0.2) --↓↓ Tweens the frames and buttons ↓↓--
				
				frame:TweenPosition(UDim2.new(0.316, 0, 2, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Quad, 2, true)
				play:TweenPosition(UDim2.new(-2, 0, 0.546, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Quad, 2, true)
				wait(1)
				settingsbutton:TweenPosition(UDim2.new(2, 0, 0.695, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Quad, 3, true)
				wait(1)
				credits:TweenPosition(UDim2.new(-2, 0, 0.843, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Quad, 4, true)
				logo:TweenPosition(UDim2.new(0.384, 0, -2, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Quad, 5, true)
				title:TweenPosition(UDim2.new(2, 0, 0.165, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Quad, 4, true)
				wait(2)
				creditsframe:TweenPosition(UDim2.new(0.03, 0, 2.358, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Quad, 4, true)
				settingsframe:TweenPosition(UDim2.new(0.721, 0, -2, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Quad, 4, true)
				wait(2.5)
				game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.All, true)
				blur.Size = 1
				game.Workspace.Sound_Folder.Music.Menu_music.MenuMusic:Stop() --Stops the music
				camera.CameraType = Enum.CameraType.Custom
				script.Parent:Destroy()
				script:Destroy()
			end)

			game.Workspace.Sound_Folder.Music.Menu_music.MenuMusic:Play() ---Plays The Music

			--↓↓ Tweens the menu after loading screen ↓↓--
			frame:TweenPosition(UDim2.new(0.316, 0, 0.508, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Back, 1, true)
			play:TweenPosition(UDim2.new(0.375, 0, 0.546, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Quad, 2, true)
			wait(1)
			settingsbutton:TweenPosition(UDim2.new(0.375, 0, 0.695, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Quad, 3, true)
			wait(1)
			credits:TweenPosition(UDim2.new(0.375, 0, 0.843, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Quad, 4, true)
			logo:TweenPosition(UDim2.new(0.384, 0, 0.058, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Quad, 5, true)
			title:TweenPosition(UDim2.new(0.132, 0, 0.165, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Elastic, 4, true)

		end)

Camera function and varible is first to update the camera before the gui pops up
Loading Screen:

local gui = script.Parent
			local bg = gui:WaitForChild("Background")
			local lb = bg:WaitForChild("LoadingBar")
			local bar = lb:WaitForChild("Bar")
			local lp = lb:WaitForChild("Loading%")
			gui.Enabled = true
			wait(2)

			game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.All, false)

			for i = 1, 100 do
				wait(0.04)
				lp.Text = "Loading..."..i.."%"
				
				
				local formula = i/100
				
				bar:TweenSize(UDim2.new(formula, 0, 1, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Elastic, 0.1, true)
				
				if i == 34 or i == 67 or i == 91 then
					wait(1)
					
				end
				
			end


			local tween = game.TweenService:Create(gui.Fade, TweenInfo.new(1.5, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {["BackgroundTransparency"]= 0} )
			tween:Play()
			tween.Completed:wait()

			bg.Visible = false
			wait(2)

			tween = game.TweenService:Create(gui.Fade, TweenInfo.new(1.5, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {["BackgroundTransparency"]= 1} )
			tween:Play()
			tween.Completed:wait()



		wait(1)
		script.Parent.Parent.MenuEvent:Fire()
			gui:Destroy()

to be honest i dont see any errors in your script and i checked both script line 12 and i dont see and errors

2 Likes

Heres the workspace maybe that will help?
Yes1

i fixed your menu script a little

local camera = game.Workspace.CurrentCamera
function updateCamera()
	camera.CameraType = Enum.CameraType.Scriptable
	camera.CFrame = game.Workspace:WaitForChild("MenuCamera").CFrame --Makes the camera go to the camera brick
end
script.Parent.Parent.MenuEvent.Event:Connect(function()
	local connection = game:GetService("RunService").RenderStepped:Connect(updateCamera)

	local player  = game.Players.LocalPlayer
	local character = player.CharacterAdded
	local mouse = player:GetMouse()
	local defaultcframe = camera.CFrame
	local view = 150
	local blur = game.Lighting.Blur
	local settingsbutton = script.Parent.Settings
	local credits = script.Parent.Credits
	local play = script.Parent.Play
	local title = script.Parent.Title
	local logo = script.Parent.Logo
	local frame = script.Parent.FrameForButtons
	local creditsframe = script.Parent.CreditsFrame
	local settingsframe = script.Parent.SettingsFrame

	blur.Size = 5 --Makes the blur higher--





	script.Parent.Play.MouseButton1Click:Connect(function() --When the player clicks the play button--
		wait(0.2) --↓↓ Tweens the frames and buttons ↓↓--
		connection:Disconnect()
		frame:TweenPosition(UDim2.new(0.316, 0, 2, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Quad, 2, true)
		play:TweenPosition(UDim2.new(-2, 0, 0.546, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Quad, 2, true)
		wait(1)
		settingsbutton:TweenPosition(UDim2.new(2, 0, 0.695, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Quad, 3, true)
		wait(1)
		credits:TweenPosition(UDim2.new(-2, 0, 0.843, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Quad, 4, true)
		logo:TweenPosition(UDim2.new(0.384, 0, -2, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Quad, 5, true)
		title:TweenPosition(UDim2.new(2, 0, 0.165, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Quad, 4, true)
		wait(2)
		creditsframe:TweenPosition(UDim2.new(0.03, 0, 2.358, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Quad, 4, true)
		settingsframe:TweenPosition(UDim2.new(0.721, 0, -2, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Quad, 4, true)
		wait(2.5)
		game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.All, true)
		blur.Size = 1
		game.Workspace.Sound_Folder.Music.Menu_music.MenuMusic:Stop() --Stops the music
		camera.CameraType = Enum.CameraType.Custom
		script.Parent:Destroy()
		script:Destroy()
	end)

	game.Workspace.Sound_Folder.Music.Menu_music.MenuMusic:Play() ---Plays The Music

	--↓↓ Tweens the menu after loading screen ↓↓--
	frame:TweenPosition(UDim2.new(0.316, 0, 0.508, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Back, 1, true)
	play:TweenPosition(UDim2.new(0.375, 0, 0.546, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Quad, 2, true)
	wait(1)
	settingsbutton:TweenPosition(UDim2.new(0.375, 0, 0.695, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Quad, 3, true)
	wait(1)
	credits:TweenPosition(UDim2.new(0.375, 0, 0.843, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Quad, 4, true)
	logo:TweenPosition(UDim2.new(0.384, 0, 0.058, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Quad, 5, true)
	title:TweenPosition(UDim2.new(0.132, 0, 0.165, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Elastic, 4, true)

end)
2 Likes

Why do i need to change the camera type to scriptable it works just fine!

1 Like

so i found the error here is both fixed scripts

loading script:

local gui = script.Parent
local bg = gui:WaitForChild("Background")
local lb = bg:WaitForChild("LoadingBar")
local bar = lb:WaitForChild("Bar")
local lp = lb:WaitForChild("Loading%")
gui.Enabled = true
wait(2)

game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.All, false)

for i = 1, 100 do
	wait(0.04)
	lp.Text = "Loading..."..i.."%"


	local formula = i/100

	bar:TweenSize(UDim2.new(formula, 0, 1, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Elastic, 0.1, true)

	if i == 34 or i == 67 or i == 91 then
		wait(1)

	end

end


local tween = game.TweenService:Create(gui.Fade, TweenInfo.new(1.5, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {["BackgroundTransparency"]= 0} )
tween:Play()
tween.Completed:wait()

bg.Visible = false
wait(2)

tween = game.TweenService:Create(gui.Fade, TweenInfo.new(1.5, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {["BackgroundTransparency"]= 1} )
tween:Play()
tween.Completed:wait()



wait(1)
script.Parent.Parent:WaitForChild("MenuEvent"):Fire()
gui:Destroy()

menu script

local camera = game.Workspace.CurrentCamera
function updateCamera()
	--camera.CameraType = Enum.CameraType.Scriptable --put scriptable if you want and dont if you dont want i put because why not?
	camera.CFrame = game.Workspace:WaitForChild("MenuCamera").CFrame --Makes the camera go to the camera brick
end
script.Parent.Parent:WaitForChild("MenuEvent").Event:Connect(function()
	local connection = game:GetService("RunService").RenderStepped:Connect(updateCamera)

	local player  = game.Players.LocalPlayer
	local character = player.CharacterAdded
	local mouse = player:GetMouse()
	local defaultcframe = camera.CFrame
	local view = 150
	local blur = game.Lighting.Blur
	local settingsbutton = script.Parent.Settings
	local credits = script.Parent.Credits
	local play = script.Parent.Play
	local title = script.Parent.Title
	local logo = script.Parent.Logo
	local frame = script.Parent.FrameForButtons
	local creditsframe = script.Parent.CreditsFrame
	local settingsframe = script.Parent.SettingsFrame

	blur.Size = 5 --Makes the blur higher--





	script.Parent.Play.MouseButton1Click:Connect(function() --When the player clicks the play button--
		wait(0.2) --↓↓ Tweens the frames and buttons ↓↓--
		connection:Disconnect()
		frame:TweenPosition(UDim2.new(0.316, 0, 2, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Quad, 2, true)
		play:TweenPosition(UDim2.new(-2, 0, 0.546, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Quad, 2, true)
		wait(1)
		settingsbutton:TweenPosition(UDim2.new(2, 0, 0.695, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Quad, 3, true)
		wait(1)
		credits:TweenPosition(UDim2.new(-2, 0, 0.843, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Quad, 4, true)
		logo:TweenPosition(UDim2.new(0.384, 0, -2, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Quad, 5, true)
		title:TweenPosition(UDim2.new(2, 0, 0.165, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Quad, 4, true)
		wait(2)
		creditsframe:TweenPosition(UDim2.new(0.03, 0, 2.358, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Quad, 4, true)
		settingsframe:TweenPosition(UDim2.new(0.721, 0, -2, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Quad, 4, true)
		wait(2.5)
		game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.All, true)
		blur.Size = 1
		game.Workspace.Sound_Folder.Music.Menu_music.MenuMusic:Stop() --Stops the music
		camera.CameraType = Enum.CameraType.Custom
		script.Parent:Destroy()
		script:Destroy()
	end)

	game.Workspace.Sound_Folder.Music.Menu_music.MenuMusic:Play() ---Plays The Music

	--↓↓ Tweens the menu after loading screen ↓↓--
	frame:TweenPosition(UDim2.new(0.316, 0, 0.508, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Back, 1, true)
	play:TweenPosition(UDim2.new(0.375, 0, 0.546, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Quad, 2, true)
	wait(1)
	settingsbutton:TweenPosition(UDim2.new(0.375, 0, 0.695, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Quad, 3, true)
	wait(1)
	credits:TweenPosition(UDim2.new(0.375, 0, 0.843, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Quad, 4, true)
	logo:TweenPosition(UDim2.new(0.384, 0, 0.058, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Quad, 5, true)
	title:TweenPosition(UDim2.new(0.132, 0, 0.165, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Elastic, 4, true)

end)
1 Like