User:Daemonika Nightfire/Scripts/Anti Rezz

From Second Life Wiki
Jump to: navigation, search

*DS* Anti Rezz

A great tool to annoy your customers. It delete the complete object by rezzing on ground and detach it after 5 minutes from avatar.

KBcaution.png Important: In Second Life are no scripts available which can protect objects/mesh against copybots!
/*
    *DS* Anti Rezz
    Dear content creator, this script will not protect your creations against copybots.
    It is a real stupid placebo, because each copybot needs just some seconds for copy all what he can see.
    For that is it not necessary to rez an object/mesh, attachments are not secure too.
    This script will not work in no script parcells, even not when it contain control permission,
    because it can not start at parcells that dont allow scripts.
 
    The only thing what you reach with scripts like this, you will loose customers!
*/
 
integer Limit = 300;    // 5 minutes
integer count = 0;      // empty counter
 
default
{
    state_entry()
    {
        //llSay(0, "Hello, Avatar!");
    }
 
    attach(key id) // gets AvatarKey who wear it automatically
    {
        if(id) // check the available key
        {
            llRequestPermissions(id, PERMISSION_ATTACH); // asks for permissions to attach/detach
        }
    }
 
    run_time_permissions(integer perm)
    {
        if(perm & PERMISSION_ATTACH) // check the requested permission
        {
            if(count < Limit) // check the counter-limit
            {
                llSetTimerEvent(1); // start the timer
                llSay(0, "This placebo detach your object after 5 minutes.");
            }
            else if(count >= Limit) // check the counter-limit
            {
                llSay(0, "Time's up, this placebo will now always remove the object immediately.");
                llDetachFromAvatar(); // detach the object from avatar when permission is given
            }
        }
    }
 
    timer()
    {
        if(count == Limit) // check the counter-limit
        {
            llSetTimerEvent(0); // stop the timer
            llDetachFromAvatar(); // detach the object from avatar when permission is given
            return; // leave the event immediately
        }
        count += 1; // counts the seconds
    }
 
    on_rez(integer Dae)
    {
        if(llGetAttached() == 0) // check for rezzing onground
        {
            llSay(0, "This placebo delete your object when you rez it on ground");
            llDie(); // delete the complete object
        }
    }
}