javelinimpact.lsl
///////////////////////////////////////////////////////////////////////////
//  Copyright (C) Wizardry and Steamworks 2014 - License: GNU GPLv3      //
//  Please see: http://www.gnu.org/licenses/gpl.html for legal details,  //
//  rights of fair usage, the disclaimer and warranty conditions.        //
///////////////////////////////////////////////////////////////////////////
 
key agent = NULL_KEY;
 
default {
    collision_start(integer num) {
        --num;
        do {
            if(llDetectedKey(num) == agent) return;
        } while(--num>-1);
        llSetStatus(STATUS_PHYSICS, FALSE);
        llSetStatus(STATUS_PHANTOM, TRUE);
        llSetTimerEvent(1);
    }
    timer() {
        llDie();
    }
    on_rez(integer num) {
        agent = llGetOwner();
    }
}