Hello, I am making a loading screen for my game and I ran into a problem. This loop is supposed to check if all of the GUI components are loaded in on the client side. The thing is it never loads. In my game it's stuck at 3 out of 17 in the player GUI, there are three "Images", not 17. I have looked at my script and don't really see anything wrong. It's in a LocalScript if that helps.
local Player = game.Players.LocalPlayer
local Images, LoadedImages = 0, 1
while Images ~= LoadedImages do
wait()
local Images = 0
local LoadedImages = 0
function IsItLoaded(item)
for _, object in pairs(item:GetChildren()) do
print(object.Name, " OK.")
if object:IsA("ImageLabel") or object:IsA("ImageButton") then
print(object.Name, " IS AN IMAGE.")
Images = Images + 1
if object.IsLoaded then
LoadedImages = LoadedImages + 1
end
end
if #object:GetChildren() > 0 then
print(object.Name, " HAS CHILDREN.")
IsItLoaded(object)
end
end
print(LoadedImages,"out of", Images)
return Images, LoadedImages
end
IsItLoaded(game.Players.PlayerGui)
end

2 comments
hmm ok
it's still only 5 images total