Noverwyn Documentation
API set:
148

‹ All natives

Namespace: ENTITY API set: server Language: Luau Improve

entity:setBucket

Also: player:setBucket

entity:setBucket(bucket: number, zone: Zone?): boolean

Changes the entity's bucket.

Two ways to use it:

  • without a zone, it is the base bucket: it stays until the next change;
  • with a zone, the bucket is given back automatically on exit, even if onExit is missing or fails, if the player disconnects, if the zone is removed or if the script stops.

Parameters#

  • bucket (number): integer from 0 to 4,294,967,295
  • zone (Zone, optional): binds the bucket to this zone

Returns#

boolean: true. With a zone: false if the entity is not inside it, and nothing changes.

Example#

classroom.onEnter = function(zone, player)
	player:setBucket(140, zone)
end

Notes#

  • As long as a zone sets a bucket, it wins over the base bucket.
  • Overlapping zones: the highest priority wins; if equal, the last one entered.
  • No client message can change a bucket.

See also#

Namespace: PLAYER

Namespace: ENTITY

Namespace: ZONE

Namespace: TIME

Namespace: SCRIPT

Namespace: EVENT

Namespace: CLIENT

Namespace: CLIENT EVENT

Namespace: UNIFORM

Namespace: WAND

Namespace: LOOK

Namespace: CONTROL

Namespace: GAIT

Namespace: VOICE

Namespace: ATELIER

Namespace: TOOL