miércoles, 25 de abril de 2012

Script de explosión - grupo 1

Aquí os dejamos un script de explosión:


integer CHANNEL = 7;
string COMMAND = "collapse";
integer OWNER_ONLY = TRUE;

// Exploding Objects script, by Dale Innis
// Do with this what you will, no rights reserved
// See https://wiki.secondlife.com/wiki/ExplodingObjects for instructions and notes

integer lh = 0;

init() {
    llListenRemove(lh);
    key who = NULL_KEY;
    if (OWNER_ONLY) who = llGetOwner();
    lh = llListen(CHANNEL,"",who,COMMAND);
    llOwnerSay("To cause collapse, say '"+COMMAND+"' on channel "+(string)CHANNEL);
    llRequestPermissions(llGetOwner(),PERMISSION_CHANGE_LINKS);
}

default {
    // usual faffing about
    state_entry() {
        init();
    }
    on_rez(integer x) {
        llResetScript();
    }
    changed(integer change) {
        if (change & CHANGED_OWNER) llResetScript();
    }
    // the part that actually does something interesting
    listen(integer c,string name,key id,string msg) {
        llSetStatus(STATUS_PHYSICS,TRUE);
        llSetPrimitiveParams([PRIM_TEMP_ON_REZ,TRUE]);
        llBreakAllLinks();      
    }
    // faffing about with permissions
    run_time_permissions(integer perms) {
        if (!(perms & PERMISSION_CHANGE_LINKS)) {
            llOwnerSay("Well, the collapsing stuff isn't going to work, then!");
        }
    }
}

No hay comentarios:

Publicar un comentario