I am trying to make it so that after the loading is done the main menu appears, and also if they skip it appears.
I looked at another post, but I don’t think it will work with my code. (am new to scripting so help is appreciated) I can send screenshots of code but, I don’t know what to send.
Do you have a script that handles when the loading is finished and when the skip button is clicked?
Because once one of those events happen, you need to run this code:
local ModuleScript = script.Parent.Parent.Parent.Settings
local Settings = require(ModuleScript)
script.Parent.Parent.Visible = true
script.Parent.Visible = true
local ContentProvider = game:GetService("ContentProvider")
local AssetFolder = Settings.LoadingScreen.AssetFolder:GetDescendants()
local TweenService = game:GetService("TweenService")
local LoadingBarTweenInfo = TweenInfo.new(0.1, Enum.EasingStyle.Linear, Enum.EasingDirection.In)
if Settings.LoadingScreen.SkipButton == true then
script.Parent.Elements.Skip.Visible = true
else
script.Parent.Elements.Skip.Visible = false
end
if Settings.LoadingScreen.LoadingBar == true then
script.Parent.LoadingBar.Visible = true
else
script.Parent.LoadingBar.Visible = false
end
if Settings.LoadingScreen.RandomizedTextEnabled == true then
script.Parent.RandomizedText.Visible = true
else
script.Parent.RandomizedText.Visible = false
end
if Settings.LoadingScreen.DefaultRobloxUI == true then
game:GetService("StarterGui"):SetCoreGuiEnabled(Enum.CoreGuiType.All, true)
else
game:GetService("StarterGui"):SetCoreGuiEnabled(Enum.CoreGuiType.All, false)
end
script.Parent.Elements.Background.Image = Settings.LoadingScreen.BackgroundImage
script.Parent.Elements.TopText.Text = Settings.LoadingScreen.TopText
script.Parent.Elements.BottomText.Text = Settings.LoadingScreen.BottomText
local LoadAssets = #AssetFolder
for i, v in pairs(AssetFolder) do
ContentProvider:PreloadAsync({v})
TweenService:Create(script.Parent.LoadingBar.LoadingBar, LoadingBarTweenInfo, {Size = UDim2.new(i/LoadAssets,0,1,0)}):Play()
end
local GradientTweenInfo = TweenInfo.new(1, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut)
TweenService:Create(script.Parent.Parent.UIGradient, GradientTweenInfo, {Offset = Vector2.new(-1,0)}):Play()
print("Assets loaded.")
wait(1)
game:GetService("StarterGui"):SetCoreGuiEnabled(Enum.CoreGuiType.All, true)
script.Parent.Visible = false
script.Parent.Parent.UIGradient:Destroy()
script.Parent.Parent.Parent:Destroy()
You can do this without code. All you need to do is set the LoadingGui’s DisplayOrder to a value higher than the Menu’s. After setting the loading screen’s Visible property to false the Menu will appear.
I mean when the LoadingGui (the ScreenGui, not the frame) has Enabled property true it will hide the Menu, when it is not the Menu will appear. Sorry if it was confusing
Is the DisplayOrder higher than the Menu ScreenGui (it is 0 in the screenshot)? You need to set that, not the frames inside. (or just set it to a huge number)