How to make a roblox loading screen code example

Example: How to make a roblox loading screen

--First you need a loading screen--
--This goes into replicated First--
--Same for the loading screen--

game.ReplicatedFirst:RemoveDefaultLoadingScreen()

local PlayerGui = game.Players.LocalPlayer:WaitForChild("PlayerGui")
PlayerGui:SetTopbarTransparency(0)

local GUI = script.LoadingScreen:Clone()
GUI.Parent = PlayerGui

wait(5)

GUI.Frame:TweenPosition(UDim2.new(0,0,1,0),"InOut","Sine",0.5)
wait(0.5)
GUI:Destroy()