integer running; string giv(integer type,integer i) { return llGetInventoryName(type,i); } default { on_rez(integer s) { llResetScript();} //Habit - llGetOwner() has a habit of returning the old owner's name when given to another person. state_entry() { llSetTimerEvent(0.3); //Repeat every 3/10th of a second. running = TRUE; } timer() { float dilation = llGetRegionTimeDilation(); //Get the dilation if(dilation < 0.65 && running) { //If the dilation is less than 65% llOwnerSay("Time Dilaton is critical! Pausing scripts!"); //Say to the owner that message integer x; for(x=0;x<llGetInventoryNumber(INVENTORY_SCRIPT);x++) { if(giv(INVENTORY_SCRIPT,x) != llGetScriptName()) { //If the script number x is not this script llSetScriptState(giv(INVENTORY_SCRIPT,x),FALSE); //Pause it } } running = FALSE; llOwnerSay("Done."); } else if (!running) { //If the dilation is more than 65% integer x; for(x=0;x<llGetInventoryNumber(INVENTORY_SCRIPT);x++) { if(giv(INVENTORY_SCRIPT,x) != llGetScriptName()) { llSetScriptState(giv(INVENTORY_SCRIPT,x),TRUE); //Enable all scripts } } running = TRUE; } } }