wiki.sine.space | sinespace

Scripting/SFurniture

From wiki.sine.space
Revision as of 06:51, 17 December 2020 by Edisonwu (Talk | contribs) (Created page with "The SFurniture class is component of RoomFurniture ==Members== {{ScriptFunction|int|InventoryItemID|;|Return the inventory ID of furniture.|5= furniture = Space.Scene.Find("...")

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

The SFurniture class is component of RoomFurniture

Members

InventoryItemID

int InventoryItemID ;

Return the inventory ID of furniture.

furniture = Space.Scene.Find("Cube").Furniture

inventoryId = furniture.InventoryItemID;
--get InventoryID of the furniture.
Space.Log(inventoryId);

--print the inventory id.


StoreCustomData

void StoreCustomData (string key, string value);

Set custom key to furniture.

furniture = Space.Scene.Find("Cube").Furniture;

--get the roomfurniture component on your furniture.
furniture.StoreCustomData("custom key","123")

--set key and value to the furniture.


GetCustomData

string GetCustomData (string key);

Get custom data from furniture.

furniture = Space.Scene.Find("Cube").Furniture;

--get the roomfurniture component.
Space.Log(furniture.GetCustomData("custom key"));

--get the value from furniture by key.