Skip to content
lsl.devlsl.devLSL Dev

llModifyLand

function
Function syntax
llModifyLand(
  1. integer action,// LAND_* action flag to perform (e.g., LAND_LEVEL, LAND_RAISE, LAND_LOWER, LAND_SMOOTH, LAND_NOISE, or LAND_REVERT). Values: ModifyLandAction
  2. integer brush// Brush size (0, 1, or 2, representing 2m x 2m, 4m x 4m, or 8m x 8m). Values: ModifyLandBrush
);
Energy
10

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).

Modify land with action on brush

The position of the prim is used to determine the input for various flags.

How to use
llModifyLand(0, 0);
ActionDescription
LAND_LEVEL0Levels on prim center
LAND_RAISE1Raises the land
LAND_LOWER2Lowers the land
LAND_SMOOTH3Smooths the land
LAND_NOISE4Makes the land rough
LAND_REVERT5Restores to baked value
BrushValueSize
LAND_BRUSH_SMALL02m x 2m
LAND_BRUSH_MEDIUM14m x 4m
LAND_BRUSH_LARGE28m x 8m
LAND_SMALL_BRUSH14m x 4m
LAND_MEDIUM_BRUSH28m x 8m
LAND_LARGE_BRUSH38m x 8m
The “LAND_*_BRUSH constants are wrong.
Use the “LAND_BRUSH_*” constants instead.
  • This function has no effect if the script’s owner is offline or not in the same sim as the scripted object.
  • Uncontrolled use of llModifyLand in scripted objects may force the region’s navmesh to rebake continually and cause Memory Allocated for the region to exceed its limit, making it impossible to rez objects. (BUG-9047)
  • This function has no effect if the scripted object is deeded to a group.
  • “LAND_BRUSH_*” constants are only present on Lua-enabled sims. On older sims, use their values 0, 1, and 2 instead. The “LAND_*_BRUSH” constants have incorrect values and are not recommended
  • If the script is in a prim that is attached to an avatar or is in the child prim of a linkset, then the local position relative to it’s attachment point or root prim is used rather than the position within the region. (BUG-4929)
  • If land is not owned by script owner or the owner doesn’t have terraform permissions, the script will silently fail.
  • You cannot change altitude beyond land terraform limits for the specified parcel..
Example 1
default
{
state_entry()
{
llSetTimerEvent(0.1);
}
timer()
{
llModifyLand(LAND_LEVEL, LAND_BRUSH_SMALL);
}
}

From the issue templates included by the wiki article:

  • SVC-3272 (fs): LSL: llModifyLandStrength
  • STORM-2006: type=bug|Brush constants are all off-by-one.
Original wiki source

Some wiki templates and tables need their original context. View this article on the Second Life Wiki. Technical wording and examples are retained from the source; historical guidance may differ from current behavior.