Skip to content
ghost314 edited this page Dec 31, 2015 · 2 revisions

##Overview

This property seems specific to Box and Stack objects and defines what's in them.

##Syntax

-- get:
local containedItem = obj.Contents

-- set:
obj.Contents = "Light"

Values:

  • <string> - a string defining the object type, for example "RemoteDoor" or "Light" etc.

##Example

-- Find and delete all boxes containing lights, in my immediate vicinity
function RemoveBoxes()
    for box, range in Pairs(this.GetNearbyObjects("Box",25) do
        if box.Contents == "Light" then
            box.Delete()
        end
    end
end

##Notes

A Box object can only contain a single unit of the specified item, whereas a Stack object can contain multiple units of the specified item. Attempting to switch the item stored in a box by calling box.Contents = <NewItem> does not seem to have any effect.

##See Also

^ Open "Pages" to Search



Guides:

  • [Lua Basics](Lua Basics Guide)
  • [Save-Load Cycle](Save-Load Cycle Guide)

[Globals](Object Globals):

  • [Game](Game (Global))
  • [me](me (Global))
  • [Object](Object (Global))
  • [this](this (Global))

[Events](Object Events):

Psuedo-Types:

  • [Rotation table](Rotation table)
  • [Id table](Id table)
  • [Location table](Location table)
  • [Velocity table](Velocity table)

[Methods](Object Methods):

[Properties](Object Properties):

Clone this wiki locally