Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Question on llInstantMessaging/DetectedKey

AngelEyes Lewis
Registered User
Join date: 18 Oct 2005
Posts: 49
05-22-2007 16:14
Okay, i'm sure some of you have seen the 'Click here to join the group' signs. The script that is in the prim just sends the owner of the prim the name of the person who clicked the sign..

So if i clicked the sign it would probably say something to the effect of 'Angeleyes Lewis wants to be added to the group!'

I am looking to create that same simple script, but have it notify two different avatars.

I tried this:


key user1 = "b95e6cc4-78b6-44c2-b8e9-6911031a5ede";
key user2 = "5f50f9d8-2957-4c74-8b0b-0bca169c3669";
string message = "Wants to be added to the group!"";

default
{
touch_start(integer total_number)
{
llInstantMessage(user1,message);
llSleep(1);
llInstantMessage(user2,message);
llSleep(1);
}
}

I tried adding a llDetectedName + " " Before the "wants to be added to the group!" but all i got was errors, i'm not sure where to put llDetectedName into the script to say who has touched it.

I was wondering if this is the best way for me to go about it, or if there is a way i could do it differently. Thanks for your help.. In advance.
Milambus Oh
Registered User
Join date: 6 Apr 2007
Posts: 224
05-22-2007 16:25
Only certain events have a trigger a valid response in the llDetected functions. It can not be used globally (outside of an event).

touch_start is one of them, so that means you simply need to move the fuction call down to there.

Like this..


key user1 = "b95e6cc4-78b6-44c2-b8e9-6911031a5ede";
key user2 = "5f50f9d8-2957-4c74-8b0b-0bca169c3669";
string message = "Wants to be added to the group!"";

default
{
touch_start(integer total_number)
{
llInstantMessage(user1,llDetectedName() + message);
llSleep(1);
llInstantMessage(user2,llDetectedName() + message);
llSleep(1);
}
}
AngelEyes Lewis
Registered User
Join date: 18 Oct 2005
Posts: 49
05-22-2007 17:21
Ty!

Got it to work. :)