// This work is licensed under the Creative Commons Attribution-Share Alike 3.0 United States License. // To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/3.0/us/ // or send a letter to Creative Commons, 171 Second Street, Suite 300, San Francisco, California, 94105, USA. // eSimple srl 2008 - www.esimple.it - www.virtuy.com // Ploreho design 2008 - www.ploreho.com // Modified by Winter Seale 2008 - winterseale.com // -- Death to the magic numbers! // -- PS, also my formating style now =p integer LM_RESET_SECRIPTS = 101; integer LM_SCALE_MESSAGE = 102; integer LM_CAN_COLOR_CHANGE = 103; integer LM_SHOW_COLOR_DIALOG = 104; integer LM_DEL_SCRIPTS = 200; string DEFAULT_SCALE = "d"; // Put this script in all the linked prims of your item vector default_scale; vector default_pos; default { state_entry() { // we record the default scale default_scale = llGetScale(); default_pos = llGetLocalPos(); } link_message(integer sender_num, integer command, string str, key id) { if (command == LM_SCALE_MESSAGE) { list primparams = []; if (str != DEFAULT_SCALE) { float scale; scale = (float)str; primparams += [PRIM_SIZE, llGetScale() * scale]; // resize if (llGetLinkNumber() > 1) { // only move if we're not the root object primparams += [PRIM_POSITION, llGetLocalPos() * scale]; // reposition } llSetPrimitiveParams(primparams); } else { primparams += [PRIM_SIZE, default_scale]; if (llGetLinkNumber() > 1) { primparams += [PRIM_POSITION, default_pos]; } llSetPrimitiveParams(primparams); } } else if (command == LM_RESET_SECRIPTS) { llResetScript(); } else if ( command == "LM_DEL_SCRIPTS" ) { llRemoveInventory( llGetScriptName() ); } } }