Description
Adds a specified number of an item to a player's inventory.
Parameters
identifier (string): The citizen ID of the player.
identifier
item (string): The name/key of the item to add.
item
amount (number, optional): Number of items to add (default: 1).
amount
1
meta (table, optional): Metadata to attach to the item (e.g., durability or custom data).
meta
slot (number, optional): Slot to insert into (default: false).
slot
false
reason (string, optional): Reason for adding item (default: 'ps_lib Add Item').
reason
'ps_lib Add Item'
Return Value
Returns the result of your inventorys add method.
Also triggers a client-side item box event if required.
Example Use Case
ps.addItem("1234567890", "water_bottle", 5) print("Added 5 water bottles to player.")
Last updated 5 months ago