GetActorInventory
An actor’s items, as SetActorInventory and GiveActorItem left them.
The weapon and the shield an actor drops at its death leave the list (they lie on the ground as pickups); the rest stays, for a mode that hands out loot from the corpse.
Syntax
Section titled “Syntax”GetActorInventory(id)| Parameter | Type | |
|---|---|---|
id |
number | the actor |
Returns
Section titled “Returns”table | nil - a list of {class =, amount =, health =, worn =}; nil when the actor was never given items (its presets dress it)
Example
Section titled “Example”function OnActorDeath(id, killer) if killer >= 0 then for _, item in ipairs(GetActorInventory(id) or {}) do if not item.worn then GivePlayerItem(killer, item.class, item.amount) end end endendSee also
Section titled “See also”SetActorInventory · SetActorLoot · OnActorDeath · the NPC actors group of the index
