I’m trying to create a custom loading screen that fades out once the game loading is complete. I’ve got the loading part down, but how do I make it fade out once the game is loaded? Below is the script I’ve tried: (It is a LocalScript)
You’re decreasing the BackgroundTransparency while you should be increasing it if you want a fade out effect.
This should work:
local Players = game:GetService("Players")
local ReplicatedFirst = game:GetService("ReplicatedFirst")
local Player = Players.LocalPlayer
local PlayerGui = Player:WaitForChild("PlayerGui")
local LoadingScreenGui = ReplicatedFirst.LoadingScreenGui
local MainFrame = LoadingScreenGui.MainFrame
LoadingScreenGui.Parent = PlayerGui
ReplicatedFirst:RemoveDefaultLoadingScreen()
wait(5)
if (not game:IsLoaded()) then
game.Loaded:Wait()
end
for i = 1, 100 do
MainFrame.BackgroundTransparency = MainFrame.BackgroundTransparency + 0.01
wait()
end