Hi there, How are your guys? As you can see, I'm a complete newbie in this forum but I hope you help me out. I'm trying to make simple script to move a Glasses To Head and To Face. I have two problems: - I need to make the script work in a random Chanel or Owner only. (What's more effective/safe); - I Have the coordinates of my avatars targets( above the noise and above the head[preventing hair]). The glasses keeps turning without the correct position. Please try to explain to me what you doing, I realy want to learn. Thanks There is the code: list buttons = ["Reset", "To Face", "To Head"];
string dialogInfo = "\nPlease make a choice.";
key ToucherID;
integer dialogChannel;
integer listenHandle;
default
{
state_entry()
{
dialogChannel = -1 - (integer)("0x" + llGetSubString( (string)llGetKey(), -7, -1) );
}
touch_start(integer num_detected)
{
ToucherID = llDetectedKey(0);
llListenRemove(listenHandle);
listenHandle = llListen(dialogChannel, "", ToucherID, "");
llDialog(ToucherID, dialogInfo, buttons, dialogChannel);
llSetTimerEvent(10.0); // To prevent
}
listen(integer channel, string name, key id, string message)
{
if (message == "Reset")
{
llDialog(ToucherID, dialogInfo, buttons, dialogChannel);
llSetPrimitiveParams([PRIM_POSITION, <-0.02654, 0.00000, 0.01689>, PRIM_ROTATION, <0.00000, 90.00000, 0.00000,1.0>]);
// Primitive head position
return;
llResetScript();
}
llListenRemove(listenHandle);
// stop timer since the menu was clicked
llSetTimerEvent(0);
if (message == "To Head")
{
llSetPrimitiveParams([PRIM_POSITION, <-0.02654,-0.00001, 0.08305>, PRIM_ROTATION, <357.00000, 72.00000, 0.00000,1.0>]);
}
else if (message == "To Face")
{
llSetPrimitiveParams([PRIM_POSITION, <-0.02654, 0.00000, 0.01689>, PRIM_ROTATION, <0.00000, 90.00000, 0.00000,1.0>]);
}
}
timer()
{
// stop timer
llSetTimerEvent(0);
llListenRemove(listenHandle);
llWhisper(0, "Sorry. You snooze; you lose.");
}
}