wiki.sine.space | sinespace

Scripting/SInventory

From wiki.sine.space
Revision as of 10:31, 12 December 2020 by Voidtech (Talk | contribs) (Defined and added simple examples to SInventory .AddToHotbar .RemoveFromHotbar)

Jump to: navigation, search

The SInventory class allows you to access a users inventory

Members

Authorize

void Authorize ();

Prompts the user to grant access to inventory to the script. Big nasty warning box.

 Space.Inventory.Authorize()


RequestRefresh

void RequestRefresh ();

Forces a check for external changes to the users inventory, can only be called once every 60 seconds

Space.Inventory.RequestRefresh()


AddToHotbar

void AddToHotbar (int index, int itemID);

Adds the first found instance of itemID to the players hotbar entry at slot 'index'.

Space.Inventory.AddToHotbar(2, 23423523)


RemoveFromHotbar

void RemoveFromHotbar (int index);

Remove item at slot index from Hotbar

Space.Inventory.RemoveFromHotbar(2)



Properties

Items[]

SInventoryItem Items[] { get; }

Returns the array of the users current inventory items

invItems = Space.Inventory.Items