Flag | Value | Default | Description |
STATUS_PHYSICS | 1 | FALSE | If value is TRUE, object moves physically. |
STATUS_ROTATE_X | 2 | TRUE | If value is FALSE, object doesn't rotate around local X axis. |
STATUS_ROTATE_Y | 4 | TRUE | If value is FALSE, object doesn't rotate around local Y axis. |
STATUS_ROTATE_Z | 8 | TRUE | If value is FALSE, object doesn't rotate around local Z axis. |
STATUS_PHANTOM | 16 | FALSE | If value is TRUE, object doesn't collide with other objects (is phantom). |
STATUS_SANDBOX | 32 | FALSE | If value is TRUE, object can't cross region boundaries or move more than 10m from its start location (and loses physical attribute). |
STATUS_BLOCK_GRAB | 64 | FALSE | If value is TRUE, object can't be grabbed and/or physically dragged. See llDetectedGrab. Note: this doesn't affect whether or not a user is able to select the object using the editing tools. |
STATUS_DIE_AT_EDGE | 128 | FALSE (TRUE for objects created with llRezObject) | If value is TRUE, objects that reach the edge of the world just die rather than returning to the owner's inventory. |
STATUS_RETURN_AT_EDGE | 256 | FALSE | If set, objects created with llRezObject will be returned to inventory instead of deleted when going off-world. Overrides STATUS_DIE_AT_EDGE. |
STATUS_CAST_SHADOWS | 512 | TRUE | PREVIEW: If set, object casts shadows on other objects (if shadows are enabled) |
float SANDBOX_LIMIT = 30; // 30m sphere around starting position. setGlobalPos(vector globalDest) { vector localDest; do { localDest = globalDest - llGetRegionCorner(); llSetPos(localDest); } while (llVecDist(llGetPos(), localDest) > 0.1); } vector startPos; default { on_rez(integer param) { llResetScript(); } state_entry() { startPos = llGetPos() + llGetRegionCorner(); llTarget(llGetPos(), SANDBOX_LIMIT); } not_at_target() { // Object went out of range. llSetStatus(STATUS_PHYSICS, FALSE); integer num = llGetInventoryNumber(INVENTORY_SCRIPT) - 1; for(;num >= 0; --num) { llSetScriptState(llGetInventoryName(INVENTORY_SCRIPT, num), FALSE); } vector curPos = llGetPos() + llGetRegionCorner(); if (llVecDist(curPos, startPos) > 128) // If someone flung the object REALLY far... setGlobalPos(llVecNorm(curPos - startPos) * SANDBOX_LIMIT + startPos); llOwnerSay("Runtime Error:"); llOwnerSay("Hit Sandbox Limit at" + (string)curPos); } }