Difference between revisions of "Remove Prim Properties"
Jump to navigation
Jump to search
Huney Jewell (talk | contribs) (Added missing llSetStatus defaults) |
m (lsl code tagging) |
||
Line 5: | Line 5: | ||
When dropped onto a prim, the script will remove the designated property and delete itself from the prim. | When dropped onto a prim, the script will remove the designated property and delete itself from the prim. | ||
=====Remove Floating Text ([[llSetText|llSetText]])===== | =====Remove Floating Text ([[llSetText|llSetText]])===== | ||
< | <lsl> | ||
default { | default { | ||
state_entry() { | state_entry() { | ||
Line 12: | Line 12: | ||
} | } | ||
} | } | ||
</ | </lsl> | ||
=====Remove Particles ([[llParticleSystem|llParticleSystem]])===== | =====Remove Particles ([[llParticleSystem|llParticleSystem]])===== | ||
< | <lsl> | ||
default { | default { | ||
state_entry() { | state_entry() { | ||
Line 21: | Line 21: | ||
} | } | ||
} | } | ||
</ | </lsl> | ||
=====Remove Sit Target ([[llSitTarget|llSitTarget]])===== | =====Remove Sit Target ([[llSitTarget|llSitTarget]])===== | ||
< | <lsl> | ||
default { | default { | ||
state_entry() { | state_entry() { | ||
Line 30: | Line 30: | ||
} | } | ||
} | } | ||
</ | </lsl> | ||
=====Reset Pie Menu "Sit" Option ([[llSetSitText|llSetSitText]])===== | =====Reset Pie Menu "Sit" Option ([[llSetSitText|llSetSitText]])===== | ||
< | <lsl> | ||
default { | default { | ||
state_entry() { | state_entry() { | ||
Line 39: | Line 39: | ||
} | } | ||
} | } | ||
</ | </lsl> | ||
=====Remove Pie Menu "Touch" Option ([[llSetTouchText|llSetTouchText]])===== | =====Remove Pie Menu "Touch" Option ([[llSetTouchText|llSetTouchText]])===== | ||
< | <lsl> | ||
default { | default { | ||
state_entry() { | state_entry() { | ||
Line 48: | Line 48: | ||
} | } | ||
} | } | ||
</ | </lsl> | ||
=====Reset to Default Prim Status ([[llSetStatus|llSetStatus]])===== | =====Reset to Default Prim Status ([[llSetStatus|llSetStatus]])===== | ||
< | <lsl> | ||
default { | default { | ||
state_entry() { | state_entry() { | ||
Line 58: | Line 58: | ||
} | } | ||
} | } | ||
</ | </lsl> | ||
[[Category:LSL Examples]] | [[Category:LSL Examples]] |
Revision as of 14:43, 30 March 2008
LSL Portal | Functions | Events | Types | Operators | Constants | Flow Control | Script Library | Categorized Library | Tutorials |
Prim Properties
Prim properties are attributes of a prim which are set via scripts, yet are retained by the prim even after the script is deleted from the prim. The two most common properties are floating text and particles. The scripts below show how to remove these properties from a prim.
When dropped onto a prim, the script will remove the designated property and delete itself from the prim.
Remove Floating Text (llSetText)
<lsl> default {
state_entry() { llSetText("", <0,0,0>, 0); llRemoveInventory(llGetScriptName()); }
} </lsl>
Remove Particles (llParticleSystem)
<lsl> default {
state_entry() { llParticleSystem([]); llRemoveInventory(llGetScriptName()); }
} </lsl>
Remove Sit Target (llSitTarget)
<lsl> default {
state_entry() { llSitTarget(ZERO_VECTOR, ZERO_ROTATION); llRemoveInventory(llGetScriptName()); }
} </lsl>
Reset Pie Menu "Sit" Option (llSetSitText)
<lsl> default {
state_entry() { llSetSitText(""); llRemoveInventory(llGetScriptName()); }
} </lsl>
Remove Pie Menu "Touch" Option (llSetTouchText)
<lsl> default {
state_entry() { llSetTouchText(""); llRemoveInventory(llGetScriptName()); }
} </lsl>
Reset to Default Prim Status (llSetStatus)
<lsl> default {
state_entry() { llSetStatus( STATUS_PHYSICS | STATUS_PHANTOM, FALSE); llSetStatus( STATUS_ROTATE_X | STATUS_ROTATE_Y | STATUS_ROTATE_Z, TRUE); llRemoveInventory(llGetScriptName()); }
} </lsl>