SlashCo Wiki

Player:SetItem

  Player:SetItem( string slot, string item )

Description

Sets the item (or effect) the player has equipped in the given slot.
If slot is omitted, it is inferred from item's ITEM.IsSecondary field ("item2" if set, "item" otherwise); if item isn't a registered item, the call does nothing.

Throws a Lua error if slot isn't "item"/"item2", or if item isn't "none" and isn't a registered ITEM or EFFECT.

Arguments

1string slot

"item" or "item2". Inferred from item when omitted.

2string item

Name of the item/effect to equip, or "none" to clear the slot.