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 (never more than the records hold, the ones they do not wear first). 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. A gift is a record of the server’s: the item counts as the player’s the moment it is given, their game makes it a moment later and tells the server, and the item check never sees it as unexplained. A take is an exact order the player’s game carries out - an item they carry in a hand or wear is released first. The /give built-in is the same call.

GivePlayerItem(pid, item [, amount, health, quality])
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)
health number the condition the items are made at, 0..100 (100, new) (optional)
quality number the quality the items are made at, 1..4 (I..IV; left out = the class’s own - a quality past what the class can be is its best) (optional)

boolean - false when not connected

GivePlayerItem(pid, "longSwordDuel")
GivePlayerItem(pid, "arrow_normal", 40)
GivePlayerItem(pid, "shortswordBroad", 1, 35) -- a battered old sword
GivePlayerItem(pid, "longSwordDuel", 1, 100, 4) -- a masterwork
GivePlayerItem(pid, "torch_weapon", -1) -- takes the torch away

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