Jump to content

Touch Detection ?


Error403Forbidden
 Share

You are about to reply to a thread that has been inactive for 1533 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

default
{

    touch_start(integer start_param)
    {

        llSay(0,"Hello, your display name is " + llGetDisplayName(llDetectedKey(0)) + " and your user name is " + llDetectedName(0) + ".");

        llSay(0, llGetDisplayName(llDetectedKey(0)) + " touched the box");

         llSay(0,  llDetectedName(0) + " touched the box.");
    }
}

Link to comment
Share on other sites

35 minutes ago, Emma Krokus said:

default
{

    touch_start(integer start_param)
    {

        llSay(0,"Hello, your display name is " + llGetDisplayName(llDetectedKey(0)) + " and your user name is " + llDetectedName(0) + ".");

        llSay(0, llGetDisplayName(llDetectedKey(0)) + " touched the box");

         llSay(0,  llDetectedName(0) + " touched the box.");
    }
}

Thank you a ton!

  • Like 2
Link to comment
Share on other sites

32 minutes ago, Emma Krokus said:

default
{

    touch_start(integer start_param)
    {

        llSay(0,"Hello, your display name is " + llGetDisplayName(llDetectedKey(0)) + " and your user name is " + llDetectedName(0) + ".");

        llSay(0, llGetDisplayName(llDetectedKey(0)) + " touched the box");

         llSay(0,  llDetectedName(0) + " touched the box.");
    }
}

Not quite, I think.    If you want the usename, then use llGetUsername(llDetectedKey(0)), I think.    llDetectedName will give your full name (Innula Zenovka) if you have a last name, otherwise Joe123 Resident.   

  • Thanks 1
Link to comment
Share on other sites

There's no reason to be calling llDetectedKey and llDetectedName more than once each:

default
{

    touch_start(integer start_param)
    {
        key avatar = llDetectedKey(0);
        string name = llDetectedName(0);

        llSay(0,"Hello, your display name is " + llGetDisplayName(avatar) + " and your user name is " + name + ".");
        llSay(0, llGetDisplayName(avatar) + " touched the box.");
        llSay(0,  name + " touched the box.");
    }
}

 

  • Like 5
  • Thanks 1
Link to comment
Share on other sites

  • 2 weeks later...

If you really want to be fancy (not that scripters would *ever* do that 😁), you can also address people with their first names only:

default
{

    touch_start(integer start_param)
    {
        key avatar = llDetectedKey(0);
        string name = llDetectedName(0);
	string firstName = llList2String(llParseString2List(name, [" "], []), 0);

        llSay(0,"Hello, " + firstName + "! Your display name is " + llGetDisplayName(avatar) + " and your user name is " + name + ".");
        llSay(0, llGetDisplayName(avatar) + " touched the box.");
        llSay(0, firstName + " touched the box.");
    }
}

 

  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...
On 7/12/2020 at 11:57 AM, Bugs Larnia said:

If you really want to be fancy (not that scripters would *ever* do that 😁), you can also address people with their first names only:


default
{

    touch_start(integer start_param)
    {
        key avatar = llDetectedKey(0);
        string name = llDetectedName(0);
	string firstName = llList2String(llParseString2List(name, [" "], []), 0);

        llSay(0,"Hello, " + firstName + "! Your display name is " + llGetDisplayName(avatar) + " and your user name is " + name + ".");
        llSay(0, llGetDisplayName(avatar) + " touched the box.");
        llSay(0, firstName + " touched the box.");
    }
}

 

Oh i like that!

  • Like 1
Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 1533 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...