SlashCo Wiki

SlashCo.ItemPickUp

 boolean SlashCo.ItemPickUp( Player ply, number itemindex, string item )

Description

Attempts to let a survivor pick up the item entity with the given itemindex.
Fails silently if the target slot is occupied, the player recently dropped an item, a slot switch is already in progress, the SlashCoItemPickUp hook blocks it, the entity is flagged DONTPICKUP, or an item ITEM.PrePickUp/ITEM.PrePickUpPrimary/ITEM.PrePickUpSecondary callback blocks it.
On success, equips the item via SlashCo.ChangeSurvivorItem and removes the world entity.

Arguments

1Player ply

The player picking up the item.

2number itemindex

EntIndex of the item entity being picked up.

3string item

Name of the item being picked up.

Returns

1boolean success

true if the pickup succeeded, otherwise nothing is returned.