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
onExitis 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
prioritywins; if equal, the last one entered. - No client message can change a bucket.