Skip to content

GivePlayerItem

Puts items in the player’s inventory - or takes them out.

amount (default 1) of the item; a negative amount takes that many away. item is any key of the item catalogue: the id, the game’s name (shortswordBroad), the English name (Duelling longsword) or the class GUID; an unknown key is logged and nothing happens. Items given here are the server’s own in the inventory audit. The /give built-in is the same call.

GivePlayerItem(pid, item [, amount])
Parameter Type
pid number the player
item string | number the item’s name, id, English name or GUID
amount number how many (1); negative takes (optional)

boolean - false when not connected

GivePlayerItem(pid, "longSwordDuel")
GivePlayerItem(pid, "arrow_normal", 40)
GivePlayerItem(pid, "torch_weapon", -1) -- takes the torch away

CreatePickup · GetPlayerInventory · GetItemClass · the Items and inventory group of the index