Hey so my issue is kinda clear, when I’m trying to open application center I keep getting stuck on loading screen. Before loading screen disappears it’s supposed to load 4 modules and it loads only 3, the latest one doesn’t want to load no clue why I’ll post here modules script and the script of the module that isn’t loading, I would appreciate any help!
Modules loading script
return function(plr)
local UI = plr.PlayerGui.Application
UI.Loading.Visible = true
UI.Main.Visible = false
local ModulesToLoad = 0
for i,v in pairs(script:GetDescendants()) do
if v:IsA("ModuleScript") then
ModulesToLoad = ModulesToLoad + 1
end
end
require(script.Loading.LoadingAnimation)(plr)
local ModulesLoaded = 0
repeat wait() until game.ReplicatedStorage.StatusLoaded.Value == true
repeat wait() until game.ReplicatedStorage.BlacklistLoaded.Value == true
for i,v in pairs(script:GetDescendants()) do
if v:IsA("ModuleScript") then
if v.Parent ~= script.DepartmentApplications and v.Parent ~= script.ClearanceApplications then
local succ, err = pcall(function()
require(v)(plr)
end)
if succ then
print("[MODULE LOADER] LOADED: " .. v.Name)
ModulesLoaded = ModulesLoaded + 1
else
warn(err)
end
end
end
end
for i,v in pairs(script.DepartmentApplications:GetChildren()) do
if v:IsA("ModuleScript") then
local succ, err = pcall(function()
local Module = require(v)
Module.SetupCard(plr)
end)
if succ then
print("[MODULE LOADER] LOADED: " .. v.Name)
ModulesLoaded = ModulesLoaded + 1
else
warn(err)
end
end
end
for i,v in pairs(script.ClearanceApplications:GetChildren()) do
if v:IsA("ModuleScript") then
local succ, err = pcall(function()
local Module = require(v)
Module.SetupCard(plr)
end)
if succ then
print("[MODULE LOADER] LOADED: " .. v.Name)
ModulesLoaded = ModulesLoaded + 1
else
warn(err)
end
end
end
require(game.ReplicatedStorage.ApplicationSetup)(plr)
print("[MODULE LOADER] LOADED: ApplicationSetup")
if ModulesLoaded == ModulesToLoad then
print('[MODULE LOADER] ALL MODULES HAVE BEEN LOADED SUCCESSFULLY')
wait(5)
plr.PlayerGui.Application.Loaded.Value = true
end
end
Module that doesn’t want to load, I haven’t found any errors anyways so I don’t know what’s the issue
local AppSelection = require(script.Selection)
local textQuestion = game.ReplicatedStorage["text-question"]
local scaleQuestion = game.ReplicatedStorage["scale-question"]
return function(plr)
local MainFrame = game.Players.LocalPlayer.PlayerGui.Application.Main
for i,v in pairs(MainFrame.DepartmentApplications.Applications:GetDescendants()) do
if v.Name == "ApplyNow" then
v.MouseButton1Click:Connect(function()
local Application = require(game.ReplicatedStorage.ApplicationSystem.DepartmentApplications:FindFirstChild(v.Parent.Name))
AppSelection.SetupApplication(plr, Application)
AppSelection.ScaleQuestion(plr)
end)
end
end
for i,v in pairs(MainFrame.ClearanceApplications.Applications:GetDescendants()) do
if v.Name == "ApplyNow" then
v.MouseButton1Click:Connect(function()
local Application = require(game.ReplicatedStorage.ApplicationSystem.ClearanceApplications:FindFirstChild(v.Parent.Name))
print(Application)
AppSelection.SetupApplication(plr, Application)
AppSelection.ScaleQuestion(plr)
end)
end
end
end