The curtains won't open unless it's someone in the group that touches the object. True, if someone NOT in the group touches it a slight fraction of a second before someone IN the group touches it, the loop will not run and the curtains will not open. It discards anyone other than the first person who touches it. For a non mission critical application, the way I wrote it is sufficient I think.
However, if you want to check each person touching during the same script cycle use:
vector offset = <1,0,0>; //Prim moves/changes size along this local coordinatefloat hi_end_fixed = FALSE; //Which end of the prim should remain in place when size changes? //The one with the higher (local) coordinate? float min = 0.2; //The minimum size of the prim relative to its maximum sizeinteger ns = 15; //Number of distinct steps for move/size change default { state_entry() { offset *= ((1.0 - min) / ns) * (offset * llGetScale()); hi_end_fixed -= 0.5; } touch_start(integer detected) { integer x; for (x=0;x<detected;x++) { if (llSameGroup(llDetectedKey(x))) { integer i; do llSetPrimitiveParams([PRIM_SIZE, llGetScale() - offset, PRIM_POSITION, llGetLocalPos() + ((hi_end_fixed * offset) * llGetLocalRot())]); while ((++i) < ns); offset = - offset; } } } }
This script adds the addition of running through the group check for each person that touched the object during the script cycle. Now you may run into the issue of two people touching during the same script cycle, both in the group, and have the curtains open then shut.