Method WorldObject:Data [-] [+]

Returns a runtime-persistent cache tied to the WorldObject. This data will remain for as long as the WorldObject exists, or until a server restart.

A reload of the Lua state will NOT clear this cache.

This cache can be added to and read from with the following sub-methods.

-- Sets the key-value pair in the cache
WorldObject:Data():Set("key", val)

-- Returns the value from the cache using the key
local val = WorldObject:Data():Get("key")

-- Removes the key-value pair from the cache
WorldObject:Data():Set("key", nil)

-- Returns all the key-value pairs as a Lua table indexed by the keys
local table = WorldObject:Data():AsTable()

Synopsis

WorldObject:Data()

Arguments

None.

Returns

Nothing.

Generated on
© 2010 - 2024 Eluna Lua Engine