I need to yield the thread before making a table because a dependency (the model inside workspace) has not loaded in. I tried doing a repeat loop with Game:IsLoaded() but it didnt do jackshit because its already loaded or true but when i then print what i need to be loaded it is still not there.
print("waiting")
repeat task.wait() until game:IsLoaded()
print("ended", game:IsLoaded())
local provinces = game.Workspace.Map
print(provinces:GetChildren())
local ProvinceConnection = {
{Name = "1", DisplayName = "", Model = provinces["1"], Neighbours = {"2","18","19"}};
{Name = "2", DisplayName = "", Model = provinces["2"], Neighbours = {"1","19","36","20","3"}};
{Name = "3", DisplayName = "", Model = provinces["3"], Neighbours = {"4","11","20","2","5"}};
{Name = "4", DisplayName = "", Model = provinces["4"], Neighbours = {"3","5"}};
{Name = "5", DisplayName = "", Model = provinces["5"], Neighbours = {"4","3","11","12","13","6"}};
...
}
return ProvinceConnection