OsDie

From OpenSimulator

(Difference between revisions)
Jump to: navigation, search
(Add exemple)
 
(5 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
{{osslfunc
 
{{osslfunc
 
|threat_level=Low
 
|threat_level=Low
|permissions=${XEngine|osslParcelOG}ESTATE_MANAGER,ESTATE_OWNER
+
|permissions=${OSSL|osslParcelOG}ESTATE_MANAGER,ESTATE_OWNER
 
|delay=0
 
|delay=0
|function_syntax=void osDie(key objectUUID)
+
|function_syntax= osDie(key objectID)
 
|description=Deletes an object depending on the target uuid.
 
|description=Deletes an object depending on the target uuid.
|additional_info=Only objects rezzed by the script can be deleted. This function can not be used on attachments, or to delete an object containing a script that calls this function.
+
|ossl_example=<source lang="lsl">
This function was added in the 0.9 version of Open Simulator.
+
//
 +
// osDie Script Example
 +
// Author: djphil
 +
//
 +
 
 +
key objectID;
 +
integer switch;
 +
 
 +
default
 +
{
 +
    state_entry()
 +
    {
 +
        if (llGetInventoryNumber(INVENTORY_OBJECT))
 +
        {
 +
            llSay(PUBLIC_CHANNEL, "Touch to see osDie usage.");
 +
        }
 +
 
 +
        else
 +
        {
 +
            llSay(PUBLIC_CHANNEL, "Inventory object missing ...");
 +
        }
 +
    }
 +
 
 +
    touch_start(integer number)
 +
    {
 +
        if (switch =! switch)
 +
        {
 +
            llRezObject("Object", llGetPos() + <0.0, 0.0, 1.0>, ZERO_VECTOR, ZERO_ROTATION, 0);
 +
        }
 +
 
 +
        else
 +
        {
 +
            osDie(objectID);
 +
        }
 +
    }
 +
 
 +
    object_rez(key uuid)
 +
    {
 +
        objectID = uuid;
 +
    }
 +
}
 +
</source>
 +
|additional_info= This function was added in the 0.9 version of Open Simulator.
 +
Only objects rezzed by the script can be deleted. This function can not be used on attachments.
 
}}
 
}}

Latest revision as of 14:43, 30 November 2020

osDie(key objectID)
Deletes an object depending on the target uuid.
Threat Level Low
Permissions ${OSSL|osslParcelOG}ESTATE_MANAGER,ESTATE_OWNER
Extra Delay 0 seconds
Example(s)
//
// osDie Script Example
// Author: djphil
//
 
key objectID;
integer switch;
 
default
{
    state_entry()
    {
        if (llGetInventoryNumber(INVENTORY_OBJECT))
        {
            llSay(PUBLIC_CHANNEL, "Touch to see osDie usage.");
        }
 
        else
        {
            llSay(PUBLIC_CHANNEL, "Inventory object missing ...");
        }
    }
 
    touch_start(integer number)
    {
        if (switch =! switch)
        {
            llRezObject("Object", llGetPos() + <0.0, 0.0, 1.0>, ZERO_VECTOR, ZERO_ROTATION, 0);
        }
 
        else
        {
            osDie(objectID);
        }
    }
 
    object_rez(key uuid)
    {
        objectID = uuid;
    }
}
Notes
This function was added in the 0.9 version of Open Simulator.

Only objects rezzed by the script can be deleted. This function can not be used on attachments.

Personal tools
General
About This Wiki