mirror of
https://github.com/unixtensor/Roblox-Elevator-Game.git
synced 2025-12-14 14:51:55 +00:00
Faster loading screen
This commit is contained in:
@@ -43,8 +43,6 @@ local Storage = game:GetService("ReplicatedStorage")
|
|||||||
local TS = game:GetService("TestService")
|
local TS = game:GetService("TestService")
|
||||||
local CoP = game:GetService("ContentProvider")
|
local CoP = game:GetService("ContentProvider")
|
||||||
|
|
||||||
local LoadingFun = true
|
|
||||||
|
|
||||||
local function GuiDependencies(IntroGui: ScreenGui): GuiDependencies
|
local function GuiDependencies(IntroGui: ScreenGui): GuiDependencies
|
||||||
IntroGui.Enabled = true
|
IntroGui.Enabled = true
|
||||||
|
|
||||||
@@ -218,12 +216,7 @@ return function(IntroGui: ScreenGui, load_elapse_start: number)
|
|||||||
if not game:IsLoaded() then
|
if not game:IsLoaded() then
|
||||||
game.Loaded:Wait()
|
game.Loaded:Wait()
|
||||||
end
|
end
|
||||||
|
|
||||||
local load_elapse = os.clock()-load_elapse_start
|
local load_elapse = os.clock()-load_elapse_start
|
||||||
if LoadingFun then
|
|
||||||
task.wait(math.max(0, 3-load_elapse)) --Only if you take longer than or exactly 4 seconds to load
|
|
||||||
end
|
|
||||||
|
|
||||||
TS:Message("Load elapse: "..tostring(load_elapse), game)
|
TS:Message("Load elapse: "..tostring(load_elapse), game)
|
||||||
|
|
||||||
GUI_LoadFinish(Gui)
|
GUI_LoadFinish(Gui)
|
||||||
|
|||||||
@@ -24,13 +24,13 @@ local function LoadingIntroGUI()
|
|||||||
end
|
end
|
||||||
|
|
||||||
local PlayerGui = Player:WaitForChild("PlayerGui")
|
local PlayerGui = Player:WaitForChild("PlayerGui")
|
||||||
IntroGui = PlayerGui:WaitForChild("rhpidframework_intro", 30)
|
IntroGui = PlayerGui:WaitForChild("rhpidframework_intro", 10)
|
||||||
|
|
||||||
if IntroGui then
|
if IntroGui then
|
||||||
--Let the magic begin
|
--Let the magic begin
|
||||||
RunIntroGui(IntroGui, load_elapse_start)
|
RunIntroGui(IntroGui, load_elapse_start)
|
||||||
else
|
else
|
||||||
warn("Waited 30 seconds for the intro gui without success")
|
warn("Waited 10 seconds for the intro gui without success")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user