i'm trying to make a custom loading screen which also shows a main menu screen, when i click play it doesn't show the loading screen and just shows the main menu. It's inside a localscript in ReplicatedFirst
local PlayerGui = game.Players.LocalPlayer:WaitForChild("PlayerGui")
PlayerGui:SetTopbarTransparency(0)
print("making thing")
--create screengui for loading screen
local screen = Instance.new("ScreenGui")
screen.Parent = PlayerGui
--create background image for loading screen
local image = Instance.new("ImageLabel")
image.Parent = screen
image.Size = UDim2.new({1, 0},{1, 0})
image.Image = "rbxgameasset://Images/impound"
image.ScaleType = "Crop"
--create text for loading screen
local text1 = Instance.new("TextLabel")
text1.Parent = screen
text1.Size = UDim2.new({0.292, 0},{0.136, 0})
text1.Position = UDim2.new({0.354, 0},{0.035, 0})
text1.BackgroundTransparency = 1
text1.Text = "Loading Assets"
text1.TextScaled = true
text1.Font = "SourceSansLight"
--create subtext for loading screen
local text2 = Instance.new("TextLabel")
text2.Parent = screen
text2.Size = UDim2.new({0.223, 0},{0.089, 0})
text2.Position = UDim2.new({0.388, 0},{0.251, 0})
text2.BackgroundTransparency=1
text2.Text = "This may take a second, Please be patient!"
text2.TextScaled = true
text1.Font = "SourceSansLight"
script.Parent:RemoveDefaultLoadingScreen()
wait(math.random(25,30))
screen.Parent = nil
--show the main menu
PlayerGui:SetTopbarTransparency(0)
local gui = PlayerGui:WaitForChild("MainMenu")
gui.MainMenu.Visible = true
gui.MainMenu.flyaway:Play()
--set the camera even though it doesn't work lol
game.Workspace.CurrentCamera.CameraType = "Scriptable"
game.Workspace.CurrentCamera.CFrame = CFrame.new(3380.12549, 444.000671, -2824.32593, -0.49998194, -0.224146292, 0.836526513, 0, 0.965925872, 0.258818746, -0.866035879, 0.129404694, -0.482945502)

2 comments
I think there might be something with the playergui part, because when something is waiting for it's child the rest of the script stops. Also, to set the camera type to scriptable you should use Enum.CameraType.Scriptable.
I can try and help you but I need live footage. Contact me via discord and what you wanted again. Person#1010