Script:inventory playeraddfromscene: Difference between revisions
mNo edit summary |
mNo edit summary |
||
Line 8: | Line 8: | ||
The item will be combined into existing stacks in the player inventory if possible which may result in the original item being destroyed. If the entity does not fit into the player inventory or is not an item that can be put into inventories then it is dropped in front of the player instead. Gold coins are added to the player's purse instead of the inventory. Equipment items are first identified before being placed in the inventory which, if successful, results in the {{Event|identify}} event being sent to the entity. | The item will be combined into existing stacks in the player inventory if possible which may result in the original item being destroyed. If the entity does not fit into the player inventory or is not an item that can be put into inventories then it is dropped in front of the player instead. Gold coins are added to the player's purse instead of the inventory. Equipment items are first identified before being placed in the inventory which, if successful, results in the {{Event|identify}} event being sent to the entity. | ||
To create a new item instead of adding an existing one use {{Command|inventory playeradd}} or {{Command|inventory playeraddmulti}}. To add an item to the inventory of a non-player entity use {{Command|inventory addfromscene}}, {{Command|inventory add}} or {{Command|inventory addmulti}} instead. | To create a new item instead of adding an existing one use {{Command|inventory playeradd}} or {{Command|inventory playeraddmulti}}. | ||
To add an item to the inventory of a non-player entity use {{Command|inventory addfromscene}}, {{Command|inventory add}} or {{Command|inventory addmulti}} instead. | |||
}} | }} |
Revision as of 10:14, 19 June 2022
The inventory playeraddfromscene
script command is used to add an existing item to the player inventory. The entity must exist in the current area or this command will have no effect.
The item will be combined into existing stacks in the player inventory if possible which may result in the original item being destroyed. If the entity does not fit into the player inventory or is not an item that can be put into inventories then it is dropped in front of the player instead. Gold coins are added to the player's purse instead of the inventory. Equipment items are first identified before being placed in the inventory which, if successful, results in the identify
event being sent to the entity.
To create a new item instead of adding an existing one use inventory playeradd
or inventory playeraddmulti
.
To add an item to the inventory of a non-player entity use inventory addfromscene
, inventory add
or inventory addmulti
instead.
Usage
inventory playeraddfromscene <entity>
Context: For self
Parameters:
Parameter | Type | Description |
---|---|---|
entity |
entity |
ID of the entity to add to the player inventory |