The Container Tool changes the container the owner is looking at. Left click applies the mode picked in the tool's settings panel: it gives the container the entered name, message or password, or fills it with random items of the chosen category up to the chosen share of its slots. Right click removes the name, the message or the password instead. The tool requires the manage_containers permission, which every action checks as well, and filling requires the fill_containers permission on top of it.

Summary

Functions

Fills the container with random items of the category and up to the share of slots set in the tool's settings.
Gives the container the message entered in the tool's settings, or removes its message.
Gives the container the name entered in the tool's settings, or removes its name.
Gives the container the password entered in the tool's settings, or removes its password.

Functions

handlers.fill(tool, owner, entity, reset)

shared plugins/containers/plugin/tools/sh_container.lua:81

Fills the container with random items of the category and up to the share of slots set in the tool's settings. Needs the 'fill_containers' permission.

Parameters

  • tool Tool the container tool
  • owner Player the tool owner
  • entity Entity the container prop
  • reset Boolean true if the owner has pressed right click, which does nothing here

Returns

  • Boolean false if nothing was added, nothing otherwise

handlers.message(tool, owner, entity, reset)

shared plugins/containers/plugin/tools/sh_container.lua:46

Gives the container the message entered in the tool's settings, or removes its message.

Parameters

  • tool Tool the container tool
  • owner Player the tool owner
  • entity Entity the container prop
  • reset Boolean true to remove the message

handlers.name(tool, owner, entity, reset)

shared plugins/containers/plugin/tools/sh_container.lua:29

Gives the container the name entered in the tool's settings, or removes its name.

Parameters

  • tool Tool the container tool
  • owner Player the tool owner
  • entity Entity the container prop
  • reset Boolean true to remove the name

handlers.password(tool, owner, entity, reset)

shared plugins/containers/plugin/tools/sh_container.lua:62

Gives the container the password entered in the tool's settings, or removes its password.

Parameters

  • tool Tool the container tool
  • owner Player the tool owner
  • entity Entity the container prop
  • reset Boolean true to remove the password

Defined in