# Parcels & Regions

> Land from a script's point of view: regions, parcels, estates and moderation.

Land is divided into regions (simulators), which belong to estates and are split into parcels. Each level has an owner and settings that limit what scripts can do there: whether scripts run, objects can be built, damage is on, or avatars may enter.

Scripts can read information about the land they are on. Changing it, or moderating visitors, needs the object to be owned by the land owner (or the right group, or estate manager).

The sky and water of a parcel or region are covered by [Environments](/features/environments/); teleporting between places by [Avatars](/features/avatar/).

## Concepts

- Parcels have [details](/functions/llGetParcelDetails/), [flags](/functions/llGetParcelFlags/), [prim counts](/functions/llGetParcelPrimCount/) and [limits](/functions/llGetParcelMaxPrims/), [owners](/functions/llGetLandOwnerAt/) and [sale](/functions/llSetParcelForSale/) settings
  - A script can check whether it is [over its owner's land](/functions/llOverMyLand/) and [who owns the prims](/functions/llGetParcelPrimOwners/) on it
  - [Parcel media](/functions/llParcelMediaCommandList/) and [music URLs](/functions/llSetParcelMusicURL/) are set per parcel
- Regions have a [name](/functions/llGetRegionName/), a [position on the grid](/functions/llGetRegionCorner/), [flags](/functions/llGetRegionFlags/), [agent counts](/functions/llGetRegionAgentCount/), performance and [simulator data](/functions/llRequestSimulatorData/)
  - [Regional settings](/functions/llGetEnv/) are read by name
  - The object hears when its [region has just come online](/constants/CHANGED_REGION_START/)
  - The [ground](/functions/llGround/) can be read and, with rights, [changed](/functions/llModifyLand/)
- Moderation is for land owners and managers
  - [Ban](/functions/llAddToLandBanList/) and [pass](/functions/llAddToLandPassList/) lists, [ejecting](/functions/llEjectFromLand/), [sending home](/functions/llTeleportAgentHome/)
  - [Returning objects](/functions/llReturnObjectsByOwner/) needs [`PERMISSION_RETURN_OBJECTS`](/constants/PERMISSION_RETURN_OBJECTS/)
- Estate managers' objects can [manage the estate access lists](/functions/llManageEstateAccess/) for agents and groups

## Functions and events

- `list` [`llGetParcelDetails`](/functions/llGetParcelDetails/) `(vector pos, list params)`
- `integer` [`llGetParcelFlags`](/functions/llGetParcelFlags/) `(vector pos)`
- `key` [`llGetLandOwnerAt`](/functions/llGetLandOwnerAt/) `(vector pos)`
- `string` [`llGetRegionName`](/functions/llGetRegionName/) `()`
- `integer` [`llGetRegionFlags`](/functions/llGetRegionFlags/) `()`
- `string` [`llGetEnv`](/functions/llGetEnv/) `(string name)`
- `key` [`llRequestSimulatorData`](/functions/llRequestSimulatorData/) `(string region, integer data)`
- `void` [`llEjectFromLand`](/functions/llEjectFromLand/) `(key avatar)`
- `integer` [`llReturnObjectsByOwner`](/functions/llReturnObjectsByOwner/) `(key owner, integer scope)`
- `integer` [`llManageEstateAccess`](/functions/llManageEstateAccess/) `(integer action, key avatar)`

## [Parcels](#parcels)

Parcel details, flags, prim counts and limits, owners and sale.

More on the [Second Life Wiki](https://wiki.secondlife.com/wiki/Category:LSL_Parcel).

## [Estates](#estates)

Estate access lists for agents and groups.

More on the [Second Life Wiki](https://wiki.secondlife.com/wiki/Category:LSL_Estate).

## Scripting Details

### Parcel functions

- `list` [`llGetParcelDetails`](/functions/llGetParcelDetails/) `(vector pos, list params)`: Returns a list containing the requested parcel details specified by params (retrieved in the same order) for the parcel at the vector pos.
- `integer` [`llGetParcelFlags`](/functions/llGetParcelFlags/) `(vector pos)`: Returns an integer bitfield of parcel flags (PARCEL_FLAG_*) for the parcel at the position pos.
- `integer` [`llGetParcelPrimCount`](/functions/llGetParcelPrimCount/) `(vector pos, integer category, integer sim_wide)`: Returns an integer representing the total land impact of objects on the parcel at pos in the specified category. If sim_wide is TRUE, returns combined usage for all regional parcels owned by the parcel owner; if FALSE, returns usage for only the specified parcel.
- `integer` [`llGetParcelMaxPrims`](/functions/llGetParcelMaxPrims/) `(vector pos, integer sim_wide)`: Returns an integer representing the maximum combined land impact (prim limit) allowed for objects on the parcel at pos, determined either for the single parcel or sim-wide based on sim_wide.
- `list` [`llGetParcelPrimOwners`](/functions/llGetParcelPrimOwners/) `(vector pos)`: Returns a list of up to 100 strides (formatted as [key owner, integer land_impact]) representing owners of objects on the parcel at pos, sorted by owner key. Requires owner-like permissions for the parcel and the script owner's presence in the region.
- `key` [`llGetLandOwnerAt`](/functions/llGetLandOwnerAt/) `(vector pos)`: Returns the key (UUID) of the land owner at the vector pos, or NULL_KEY if the land is public.
- `integer` [`llOverMyLand`](/functions/llOverMyLand/) `(key id)`: Returns TRUE if the avatar or object specified by key id is over land owned by the script owner, or FALSE otherwise.
- `integer` [`llSetParcelForSale`](/functions/llSetParcelForSale/) `(integer ForSale, list Options)`: Sets the parcel the object is on for sale. If ForSale is TRUE, puts the land up for sale using Options (price, buyer, objects included). Setting ForSale to FALSE removes the parcel from sale. Requires parcel ownership and the PERMISSION_PRIVILEGED_LAND_ACCESS permission. Returns an error code or 0 if successful.
- `void` [`llParcelMediaCommandList`](/functions/llParcelMediaCommandList/) `(list commandList)`: Controls the playback of movies and other multimedia resources on a parcel or for an agent, using the PARCEL_MEDIA_COMMAND_* settings specified in commandList.
- `list` [`llParcelMediaQuery`](/functions/llParcelMediaQuery/) `(list query)`: Queries the media properties of the parcel containing the script, returning a list of values in the order requested by query. Only works if the object is owned by the landowner or deeded to the land's group.
- `void` [`llSetParcelMusicURL`](/functions/llSetParcelMusicURL/) `(string url)`: Sets the streaming audio (music) URL for the parcel containing the object. The object owner must match the landowner or land group.
- `string` [`llGetParcelMusicURL`](/functions/llGetParcelMusicURL/) `()`: Returns a string containing the parcel's streaming music (audio) URL. The object owner must also be the land owner (or share the same group deeding).

### Region functions

- `string` [`llGetRegionName`](/functions/llGetRegionName/) `()`: Returns a string containing the name of the current region.
- `vector` [`llGetRegionCorner`](/functions/llGetRegionCorner/) `()`: Returns a vector (in meters) representing the global grid coordinates of the south-west corner of the current region (Z component is always 0.0).
- `integer` [`llGetRegionFlags`](/functions/llGetRegionFlags/) `()`: Returns an integer bitfield representing the region flags (REGION_FLAG_*) currently enabled for the region containing the object.
- `string` [`llGetEnv`](/functions/llGetEnv/) `(string name)`: Returns a string containing the requested regional data specified by name.
- `integer` [`llGetRegionAgentCount`](/functions/llGetRegionAgentCount/) `()`: Returns an integer representing the current number of avatars in the region.
- `list` [`llGetAgentList`](/functions/llGetAgentList/) `(integer scope, list options)`: Requests a list of avatar UUID keys for agents currently in the region, limited by scope. Returns a list of keys or a list containing an error message string.
- `key` [`llRequestSimulatorData`](/functions/llRequestSimulatorData/) `(string region, integer data)`: Asynchronously requests data (using a DATA_SIM_* constant) about the region. Triggers a dataserver event and returns a key query handle.
- `string` [`llGetSimulatorHostname`](/functions/llGetSimulatorHostname/) `()`: Returns a string containing the hostname of the server machine running the script (e.g., 'sim225.agni.lindenlab.com').
- `float` [`llGetRegionFPS`](/functions/llGetRegionFPS/) `()`: Returns a float representing the average region simulator frames per second (FPS).
- `float` [`llGetRegionTimeDilation`](/functions/llGetRegionTimeDilation/) `()`: Returns a float representing the current physics time dilation of the region, ranging from 0.0 (full dilation / slow) to 1.0 (no dilation / real-world speed).
- `float` [`llGetSimStats`](/functions/llGetSimStats/) `(integer stat_type)`: Returns a float containing the value of the requested region statistic specified by stat_type.
- `integer` [`llEdgeOfWorld`](/functions/llEdgeOfWorld/) `(vector pos, vector dir)`: Checks if the border reached along the vector dir from the vector pos is the edge of the world (i.e., has no neighboring simulator). Returns TRUE if it hits the edge of the world, or FALSE if there is a neighboring simulator.
- `void` [`llModifyLand`](/functions/llModifyLand/) `(integer action, integer brush)`: Modifies the terrain using the specified land action and brush size (0, 1, or 2, corresponding to 2m x 2m, 4m x 4m, or 8m x 8m).
- `integer` [`llSetGroundTexture`](/functions/llSetGroundTexture/) `(list changes)`: Changes the painted terrain textures on the region based on changes. The script owner must have estate management rights. Returns an integer status.
- `float` [`llGround`](/functions/llGround/) `(vector offset)`: Returns a float representing the ground height directly below the prim's position offset by the vector offset.
- `void` [`llGroundRepel`](/functions/llGroundRepel/) `(float height, integer water, float tau)`: Critically damps the object's vertical motion to height (using critical damping timescale tau) if it is within height * 0.5 of the terrain (or water level if water is TRUE). Only works on physics-enabled objects; do not use with vehicles.
- `integer` [`CHANGED_REGION_START`](/constants/CHANGED_REGION_START/) `= 0x400`: Region containing this object has just come online.

### Moderation and estate functions

- `void` [`llAddToLandBanList`](/functions/llAddToLandBanList/) `(key avatar, float hours)`: Adds the avatar to the parcel ban list for the specified number of hours. A value of 0 hours adds the avatar indefinitely. Banned users teleporting to the parcel are redirected to a neighboring parcel; the minimum accepted duration is 0.01 hours (approximately 36 seconds).
- `void` [`llRemoveFromLandBanList`](/functions/llRemoveFromLandBanList/) `(key avatar)`: Removes the specified avatar from the land parcel's ban list.
- `void` [`llResetLandBanList`](/functions/llResetLandBanList/) `()`: Removes all blocked residents from the land parcel's ban list.
- `void` [`llAddToLandPassList`](/functions/llAddToLandPassList/) `(key avatar, float hours)`: Adds the avatar to the land pass list for the specified number of hours (or indefinitely if hours is 0).
- `void` [`llRemoveFromLandPassList`](/functions/llRemoveFromLandPassList/) `(key avatar)`: Removes the specified avatar from the land parcel's pass/access list.
- `void` [`llResetLandPassList`](/functions/llResetLandPassList/) `()`: Removes all residents from the land parcel's access/pass list.
- `void` [`llEjectFromLand`](/functions/llEjectFromLand/) `(key avatar)`: Ejects the specified avatar from land/parcels owned by the object's owner (group or resident).
- `void` [`llTeleportAgentHome`](/functions/llTeleportAgentHome/) `(key avatar)`: Teleports the avatar (who must be standing on land owned by the script owner) directly to their designated home location without warning (similar to a God Summons).
- `integer` [`llReturnObjectsByID`](/functions/llReturnObjectsByID/) `(list objects)`: Returns objects specified by the list of UUIDs objects to their owners. Requires the PERMISSION_RETURN_OBJECTS permission, and the script owner must own the parcel or be an estate manager/region owner.
- `integer` [`llReturnObjectsByOwner`](/functions/llReturnObjectsByOwner/) `(key owner, integer scope)`: Returns objects owned by owner within the specified scope (parcel, parcel owner, or region). Requires the PERMISSION_RETURN_OBJECTS permission, and the script owner must own the parcel or be an estate manager/region owner.
- `integer` [`PERMISSION_RETURN_OBJECTS`](/constants/PERMISSION_RETURN_OBJECTS/) `= 0x10000`: Runtime permission required to use the llReturnObjectsByID and llReturnObjectsByOwner functions to return objects from parcels.
- `integer` [`llManageEstateAccess`](/functions/llManageEstateAccess/) `(integer action, key avatar)`: Adds or removes agents from the estate's access or ban lists, or groups from the estate's group access list, specified by the action. Returns TRUE if successful, or FALSE if throttled, if the action/ID is invalid, or if the script owner lacks estate management rights.

## Additional

- [`llGetParcelDetails`](/functions/llGetParcelDetails/) — [parcel details](/constants/groups/ParcelDetailsParam/) to read, including [teleport routing](/constants/groups/ParcelTeleportRouting/)
- [`llGetParcelFlags`](/functions/llGetParcelFlags/) — [parcel flags](/constants/groups/ParcelFlag/)
- [`llGetParcelPrimCount`](/functions/llGetParcelPrimCount/) — [prim count categories](/constants/groups/ParcelPrimCountCategory/)
- [`llSetParcelForSale`](/functions/llSetParcelForSale/) — [sale parameters](/constants/groups/ParcelSaleParam/) and [errors](/constants/groups/ParcelSaleError/)
- [`llParcelMediaCommandList`](/functions/llParcelMediaCommandList/) — [media commands](/constants/groups/ParcelMediaCommand/); [`llParcelMediaQuery`](/functions/llParcelMediaQuery/) — [media queries](/constants/groups/ParcelMediaQuery/)
- [`llReturnObjectsByOwner`](/functions/llReturnObjectsByOwner/) — [scope](/constants/groups/ReturnObjectsScope/) and [errors](/constants/groups/ReturnObjectsError/)
- [`llGetRegionFlags`](/functions/llGetRegionFlags/) — [region flags](/constants/groups/RegionFlag/)
- [`llRequestSimulatorData`](/functions/llRequestSimulatorData/) — [simulator data](/constants/groups/SimulatorData/); [`llGetSimStats`](/functions/llGetSimStats/) — [simulator stats](/constants/groups/SimulatorStat/)
- [`llGetAgentList`](/functions/llGetAgentList/) — [scope](/constants/groups/AgentListScope/)
- [`llModifyLand`](/functions/llModifyLand/) — [actions](/constants/groups/ModifyLandAction/) and [brushes](/constants/groups/ModifyLandBrush/); [`llSetGroundTexture`](/functions/llSetGroundTexture/) — [parameters](/constants/groups/GroundTextureParam/)
- [`llManageEstateAccess`](/functions/llManageEstateAccess/) — [estate access actions](/constants/groups/EstateAccessParam/)

## Moderation

Constant groups: [ReturnObjectsScope](/constants/groups/ReturnObjectsScope/) (3), [ReturnObjectsError](/constants/groups/ReturnObjectsError/) (5)

See also: [Land Moderation](/categories/land_moderation/)

## Parcels

Constant groups: [ParcelDetailsParam](/constants/groups/ParcelDetailsParam/) (14), [ParcelFlag](/constants/groups/ParcelFlag/) (16), [ParcelPrimCountCategory](/constants/groups/ParcelPrimCountCategory/) (6), [ParcelSaleParam](/constants/groups/ParcelSaleParam/) (3), [ParcelSaleError](/constants/groups/ParcelSaleError/) (6), [ParcelTeleportRouting](/constants/groups/ParcelTeleportRouting/) (3), [ParcelMediaCommand](/constants/groups/ParcelMediaCommand/) (14), [ParcelMediaQuery](/constants/groups/ParcelMediaQuery/) (6)

See also: [Parcel](/categories/parcel/), [Parcel Media](/categories/parcel_media/), [LSL Parcel (Second Life Wiki)](https://wiki.secondlife.com/wiki/Category:LSL_Parcel), [Script library: region and parcel (Second Life Wiki)](https://wiki.secondlife.com/wiki/CatRegion)
   (planned: Guide: parcel and region scripting rights)

## Regions

Constant groups: [RegionFlag](/constants/groups/RegionFlag/) (10), [SimulatorData](/constants/groups/SimulatorData/) (3), [SimulatorStat](/constants/groups/SimulatorStat/) (27), [ModifyLandAction](/constants/groups/ModifyLandAction/) (6), [ModifyLandBrush](/constants/groups/ModifyLandBrush/) (3), [GroundTextureParam](/constants/groups/GroundTextureParam/) (20), [AgentListScope](/constants/groups/AgentListScope/) (3)

See also: [Region](/categories/region/), [LSL Region (Second Life Wiki)](https://wiki.secondlife.com/wiki/Category:LSL_Region)

## Estates

Constant groups: [EstateAccessParam](/constants/groups/EstateAccessParam/) (6)

See also: [LSL Estate (Second Life Wiki)](https://wiki.secondlife.com/wiki/Category:LSL_Estate)

## Related

See also: [Environments](/features/environments/), [Avatars](/features/avatar/), [Pathfinding](/features/pathfinding/)

## Related features

- [Environments](/features/environments/)
- [Avatars](/features/avatar/)
- [Money](/features/money/)

## Categories

- [Parcel](/categories/parcel/)
- [Parcel Media](/categories/parcel_media/)
- [Land Moderation](/categories/land_moderation/)
- [Region](/categories/region/)

---

From lsl.dev: https://lsl.dev/features/land/
