# Last Created Loot Units
Grammar — Last created loot units
Flags —Native
|Function
Returns the last group of units/items created via the “Drop Loot At Unit” or “Drop Loot At Point” actions. This function ignores units created by other triggers.
Returns — unitgroup
native unitgroup UnitLootLastCreatedGroup();
# Related
Category: Loot / Basic
- Create Loot At Unit —
void
— UnitLootDropUnit - Create Loot At Point —
void
— UnitLootDropPoint - Last Created Loot Unit —
unit
— UnitLootLastCreated - Last Created Loot Units —
unitgroup
— UnitLootLastCreatedGroup
# Examples
mods/warcoop/warcoopdata.sc2mod — base.sc2data/TriggerLibs/WarCoopData.galaxy:3809
if ((lv_heroitemcategory == UserDataGetUserInstance("LootDropLevels", lv_lootlevelinstance, "HeroItemCategory", 1)) && (lv_triggeringeffect == UserDataGetGameLink("LootDropLevels", lv_lootlevelinstance, "LootEffect", 1))) {
UnitLootDropPoint(lv_legendplayer, EventPlayerEffectUsedPoint(c_effectLocationCasterUnit), UserDataGetGameLink("LootDropLevels", lv_lootlevelinstance, "LootDrop", 1), lv_legendplayer);
autoD6406425_g = UnitLootLastCreatedGroup();
autoD6406425_u = UnitGroupCount(autoD6406425_g, c_unitCountAll);
for (;; autoD6406425_u -= 1) {