Skip to content

SetPlayerItemWeight

Gives one of the player’s tagged items a weight of its own - a heavy relic, a feather-light charm.

weight is in kilograms, 0 to 1000, in place of the class’s own (GetItemInfo weight): the game’s inventory shows it and counts it in what the player carries - an overloaded player cannot sprint or mount, as with the game’s own items - and the server’s carry-weight check weighs the item by it. nil gives the class’s back. The weight belongs to the item: it goes with it into a chest, a saddlebag, a corpse or another player’s bag, and GetPlayerInventory lists it as weight. Works on an item still on its way, right after GivePlayerTaggedItem.

SetPlayerItemWeight(pid, id, weight)
Parameter Type
pid number the player
id string the tagged item’s id
weight number | nil kilograms; nil = the class’s own

boolean - false when the player holds no item with that id, or for a weight outside 0..1000

GivePlayerTaggedItem(pid, "artefakt_relic", "abbey-relic", "The abbey's reliquary", "Gilded, and heavier than it looks.")
SetPlayerItemWeight(pid, "abbey-relic", 25) -- it slows the thief down

SetPlayerItemPrice · GivePlayerTaggedItem · GetPlayerInventory · the Items and inventory group of the index