(Added simple example to SInventory .Authorize() .Items .RequestRefresh()) |
(Defined and added simple examples to SInventory .AddToHotbar .RemoveFromHotbar) |
||
Line 7: | Line 7: | ||
{{ScriptFunction|void|RequestRefresh|();|Forces a check for external changes to the users inventory, can only be called once every 60 seconds|5= | {{ScriptFunction|void|RequestRefresh|();|Forces a check for external changes to the users inventory, can only be called once every 60 seconds|5= | ||
<pre>Space.Inventory.RequestRefresh()</pre>}} | <pre>Space.Inventory.RequestRefresh()</pre>}} | ||
+ | |||
+ | {{ScriptFunction|void|AddToHotbar|(int index, int itemID);|Adds the first found instance of itemID to the players hotbar entry at slot 'index'.|5= | ||
+ | <pre>Space.Inventory.AddToHotbar(2, 23423523)</pre>}} | ||
+ | |||
+ | {{ScriptFunction|void|RemoveFromHotbar|(int index);|Remove item at slot index from Hotbar|5= | ||
+ | <pre>Space.Inventory.RemoveFromHotbar(2)</pre>}} | ||
+ | |||
+ | |||
==Properties== | ==Properties== |
The SInventory class allows you to access a users inventory
Prompts the user to grant access to inventory to the script. Big nasty warning box.
Space.Inventory.Authorize()
Forces a check for external changes to the users inventory, can only be called once every 60 seconds
Space.Inventory.RequestRefresh()
Adds the first found instance of itemID to the players hotbar entry at slot 'index'.
Space.Inventory.AddToHotbar(2, 23423523)
Remove item at slot index from Hotbar
Space.Inventory.RemoveFromHotbar(2)
Returns the array of the users current inventory items
invItems = Space.Inventory.Items
|