Skip to content

GetCorpseItems

What a corpse holds.

A corpse is a dead player’s body left after the respawn ([combat] corpse_seconds; its id comes with OnPlayerCorpse). It holds what the mode put on it with SetCorpseItems, less what searches have taken since. One of the mode’s tagged items (GivePlayerTaggedItem) on it is an entry of its own, and goes to whoever takes it with its tag.

GetCorpseItems(corpse)
Parameter Type
corpse number the corpse’s id

table - a list of {class=, amount=, health=, quality=} (quality when known; a tagged item also id=, name=, text=); nil when there is no such corpse (it is gone)

local items = GetCorpseItems(corpse)
if items and #items == 0 then RemoveCorpse(corpse) end -- searched bare: take it away

SetCorpseItems · OnPlayerCorpse · RemoveCorpse · the Combat group of the index