so, here is what I did for the root:
integer gchannel;
default
{
state_entry()
{
gchannel = 0x80000000 | (integer) ( "0x" + (string) llGetOwner() );
}
link_message(integer link, integer num, string msg, key id)
{
if(msg == "5")
{
key id = llDetectedKey(0);
llRegionSayTo(id, gchannel, "earringblue");
}
else if(msg == "4")
{
key id = llDetectedKey (0);
llRegionSayTo (id, gchannel, "earringpurple");
}
else if(msg == "3")
{
key id = llDetectedKey (0);
llRegionSayTo (id, gchannel, "earringyellow");
}
else if(msg == "2")
{
key id = llDetectedKey (0);
llRegionSayTo (id, gchannel, "earringpink");
}
}
}
and this is what i did for the child prims
default
{
state_entry()
{
llSetObjectName((string)llGetLinkNumber());
}
touch_start(integer num)
{
llMessageLinked(LINK_ROOT,(integer)llGetObjectName(),"Clicked","");
}
}
I actually folllowed a little tutorial but as I said the clicking only works when the hud is on the ground and not when i attach it..