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.
01 | function checkIfEnemy(group, enemyGroup) |
02 | local pages = game:GetService( "GroupService" ):GetEnemiesAsync(group) |
05 | for _, group in pairs (pages:GetCurrentPage()) do |
06 | if group.Id = = enemyGroup then |
10 | if pages.IsFinished then |
13 | pages:AdvanceToNextPageAsync() |
18 | print (checkIfEnemy( 28 , 131688 )) |
19 | 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.
02 | Name = "Knights of the Seventh Sanctum " ; |
09 | 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. " ; |
18 | Name = "Earth Walker" ; |
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
.