Open Group Join Script

Date 2008/4/1 0:30:00 | Topic: Agent/Avatar

This script will give Touchers a link to the Group's Information window, where they can click the JOIN GROUP button.

Now includes separate version for Touch or Collision with object!
The object this script is in must be set to Group you want people to Join. The group must be Open Enrollment.

TIP: If the object Group must be different because of land settings use this object somewhere where you are allowed and Copy the message said from Chat History. Then create a simple script that whispers this message when Touched.


TOUCH VERSION Users Touch and receive message

string groupkey;

findgroupkey()
{
    list 
llGetObjectDetails(llGetKey(), [OBJECT_GROUP]);
    
groupkey llList2String(a,0);
    if (
groupkey == "00000000-0000-0000-0000-000000000000")
    {
        
llWhisper(0"Set the Group for this object in EDIT under the GENERAL tab and be sure your Group is Open Enrollment.");
    }
    else
    {
        
llWhisper(0"Click the link from Chat History (Ctrl+H) and then click on JOIN button! secondlife:///app/group/groupkey "/about");
    }
}

default
{
    
state_entry()
    {
        
llSetText("Touch to Join\nour Group", <1,1,1>, 1.0); //Floating Text, edit or remove
        
findgroupkey();
    }

    
touch_start(integer total_number)
    {
        
findgroupkey();
    }
}


COLLISION VERSION Users walk onto/bump into object and receive message

OBJECT MUST NOT BE PHANTOM!!!

TIP: Make a big but very thin object like a welcome mat and set at teleport landing spot so everyone will need to step on it.

string groupkey;

findgroupkey(key user)
{
    list 
llGetObjectDetails(llGetKey(), [OBJECT_GROUP]);
    
groupkey llList2String(a,0);
    if (
groupkey == "00000000-0000-0000-0000-000000000000")
    {
        
llWhisper(0"Set the Group for this object in EDIT under the GENERAL tab and be sure your Group is Open Enrollment.");
    }
    else
    {
        if (
user == NULL_KEY)
        {
            
llWhisper(0"Click the link from Chat History (Ctrl+H) and then click on JOIN button! secondlife:///app/group/groupkey "/about");
        }
        else
        {
            
llInstantMessage(user"Click the link from Chat History (Ctrl+H) and then click on JOIN button! secondlife:///app/group/groupkey "/about");
        }
    }
}

default
{
    
state_entry()
    {
        
//llSetText("", <1,1,1>, 1.0); //Floating Text, edit or remove
        
findgroupkey(NULL_KEY);
    }

    
collision_start(integer total_number)
    {
        
findgroupkey(llDetectedKey(0));
    }
}




This script comes from Alicia Stella Design - Best Tip Jars in Second Life
http://www.aliciastella.com

The URL for this script is:
http://www.aliciastella.com/modules/AMS/article.php?storyid=21