In the case of the GetEnemiesAsync function, it will return a Pages instance which is essentially just an array of pages that have all the enemy groups of that particular group on it. To advance to the next page, you can use the the function AdvanceToNextPageAsync. Here is an example on how to check to see if a particular group is an enemy of another.
function checkIfEnemy(group, enemyGroup)
local pages = game:GetService("GroupService"):GetEnemiesAsync(group)
local isEnemy = false
while true do
for _, group in pairs(pages:GetCurrentPage()) do
if group.Id == enemyGroup then
isEnemy = true
end
end
if pages.IsFinished then
break
end
pages:AdvanceToNextPageAsync()
end
return isEnemy
end
print(checkIfEnemy(28, 131688))
print(checkIfEnemy(28, 100))
The main thing to point out here is that a Pages object is an array of pages and each page has groups on it. Here is a example of what the layout of one of these groups would look like.
local group = {
Name = "Knights of the Seventh Sanctum ";
Id = 377251;
Owner = {
Name = "Vilicus";
Id = 23415609;
};
EmblemUrl = "http://www.roblox.com/asset/?id=60428602";
Description = "We fight alongside the balance to make sure no one becomes to powerful. For guidance we look to the Earth as there is nothing more pure. ";
Roles = {
{
Name = "Apprentice";
Rank = 1;
}, {
Name = "Warrior";
Rank = 2;
}, {
Name = "Earth Walker";
Rank = 255;
}
};
}
Knowing this you could rip apart the group piece by piece. Say you want the Description of the group, you'd simple use the line group.Description.