Weekly Raffle
Top Free Scripts
ASD Web Tools
Get Legacy, Display, & Username
 
Script ID : 46
Published Date: 2013/3/14 4:37:28
Reads : 3256
Agent/Avatar

Scripts to get avatar's Legacy Name, Display Name, and Username when touched.

The script at bottom has all functions together, but it's best to use the single function ones when adding into your own scripts.

Get Legacy Name

default
{
    
state_entry()
    {
        
llSay(0"Touch to learn your Legacy Name. (FirstName LastName)");
    }

    
touch_start(integer total_number)
    {
        
llSay(0"Your Legacy Name is: "+llDetectedName(0));
    }
}


Get Display Name
default
{
    
state_entry()
    {
        
llSay(0"Touch to learn your Display Name.");
    }

    
touch_start(integer total_number)
    {
        
llSay(0"Your Display Name is: "+llGetDisplayName(llDetectedKey(0)));
    }
}


Get Username
key the_name_query;

default
{
    
state_entry()
    {
        
llSay(0"Touch to learn your Username.");
    }

    
touch_start(integer total_number)
    {
        
the_name_query llRequestUsername(llDetectedKey(0));
    }
    
    
dataserver(key queryidstring data)
    {
        if (
the_name_query == queryid)
        {
            
llSay(0"Your Username is: " data);
        }
    }
}


Get All Names
key the_name_query;
key userkey;

default
{
    
state_entry()
    {
        
llSay(0"Touch to learn your Username, Legacy Name, & Display Name.");
    }

    
touch_start(integer total_number)
    {
        
userkey llDetectedKey(0);
        
the_name_query llRequestUsername(userkey);
    }
    
    
dataserver(key queryidstring data)
    {
        if (
the_name_query == queryid)
        {
            
llSay(0"Requested Info:
            Your Username is: " 
data "
            Your Legacy Name is: " 
llKey2Name(userkey) + "
            Your Display Name is: " 
llGetDisplayName(userkey));
        }
    }
}

Printer Friendly Page Send this Script to a Friend

Disclaimer: While I do not mind if these scripts are used in things you sell, I do not wish for these scripts to be sold either on their own or in script packs.
Now Available
Visit ASD Studios Hollywood
Search for Help
Monthly Free Item
Confetti Machine


Limit one per avatar
Teleport Now!



Sponsor

Site Info
Total Hits: