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.

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

table - a list of {class=, amount=, health=}; 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