De DigiWiki.
// Author: mewtwo0641
// Simple example for osForceAttachToOtherAvatarFromInventory that attaches a list of items on touch
// List of items in object inventory to be attached in format: item_name, attach_point
list items = [
"Belt", (string)ATTACH_BELLY,
"Hat", (string)ATTACH_HEAD,
"Left Shoe", (string)ATTACH_LFOOT,
"Right Shoe", (string)ATTACH_RFOOT
];
key toucher;
default
{
touch_start(integer x)
{
toucher = llDetectedKey(0);
integer i = 0;
for(i; i < llGetListLength(items); i++)
{
string name = llList2String(items, i);
integer point = (integer)llList2String(items, i + 1);
osForceAttachToOtherAvatarFromInventory(toucher, name, point);
i++;
}
}
}