Defines the Small Bag storage item, which adds 4 to its carrier's inventory weight limit, is limited to two per player and drops as a boxed_bag.

Summary

Methods

Always allows the bag to be picked up.
Blocks taking the bag from storage when its owner would be left over their weight limit or the player already carries two small bags.
Drops the bag as a boxed_bag item entity.
Blocks dropping the bag, with a notification, when the player would be left over their weight limit.

Methods

ITEM:CanPickup(player, quickUse, itemEntity)

shared gamemodes/cwhl2rp/schema/items/sh_small_bag.lua:40

Always allows the bag to be picked up.

Parameters

  • player
  • quickUse
  • itemEntity

ITEM:CanTakeStorage(player, storageTable)

shared gamemodes/cwhl2rp/schema/items/sh_small_bag.lua:21

Blocks taking the bag from storage when its owner would be left over their weight limit or the player already carries two small bags.

Parameters

  • player
  • storageTable

ITEM:OnCreateDropEntity(player, position)

shared gamemodes/cwhl2rp/schema/items/sh_small_bag.lua:15

Drops the bag as a boxed_bag item entity.

Parameters

  • player
  • position

Returns

  • Entity The spawned item entity

ITEM:OnDrop(player, position)

shared gamemodes/cwhl2rp/schema/items/sh_small_bag.lua:45

Blocks dropping the bag, with a notification, when the player would be left over their weight limit.

Parameters

  • player
  • position

Defined in