Skip to content

Return of Reckoning

Wiki

RoR Wiki

API:GameData.InteractData.GetLootableItem

From RoR Wiki
Revision as of 19:42, 16 October 2026 by Maintenance script (talk | contribs) (UI Lua API import (WAR 1.4.8))
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

UI Lua API · Loot functions
Version: WAR 1.4.8

Returns one item of the loot list of the corpse or object the player is looting.

item = GameData.InteractData.GetLootableItem(index)

Arguments

index
number – Position of the item in the loot list, starting at 0.

Returns

item
table – An item data table, or nothing if index is outside the list.

Details

  • Unlike most list functions, the index is zero-based: GetLootableItem(0) returns the first entry of GameData.InteractData.GetLootList, which is [1] in the table from that function.
  • If the Lua state is not available, the function returns nothing.
  • The stock UI never calls this function.
  • Exactly one argument must be passed.

Errors

None besides the generic Invalid Parameters message when the argument is missing or not a number.

Example

A minimal example built from the signature:

local first = GameData.InteractData.GetLootableItem( 0 )
if first ~= nil then
    LabelSetText( "MyLootLabel", first.name )
end

See also