Need help with table

Im currently making a loading screen that loads ALL assets in the game. I ran into a little problem where I get a error "The current identity (2) cannot Class security check (lacking permission 6) ". Now I think this is do to me accessing something that cant be accessed so I need help on filtering it so I can access everything else. Thanks

CODE:

function loadGameData()
	local loaded = {}
	for _, object in pairs(game:GetDescendants()) do
		table.insert(loaded, object)
	end
	return loaded
end

You can’t move services into a table.

function loadGameData()
	local loaded = {}
	for _, object in pairs(workspace:GetDescendants()) do
		table.insert(loaded, object)
	end
	for _, object in pairs(game.ServerStorage:GetDescendants()) do
		table.insert(loaded, object)
	end
	for _, object in pairs(game.ReplicatedStorage:GetDescendants()) do
		table.insert(loaded, object)
	end

	return loaded
end

Add more loops from the location you want.

Yes, ive seen that just now, but I tried using Get Children then decedents but still same error

For waiting for world instances to load use IsLoaded() instead, and also use a PreloadAsync() for Images, Sounds and such using ContentProvider.

1 Like

well yep that works, why didn’t I think of that before posting, I’m kind of brain dead after today lol.

haha, you’re welcome, happy to help ^ - ^
@njesk12 is right, but I assume you are putting things in a table to count each type.

1 Like