Jump to content
You are about to reply to a thread that has been inactive for 4243 days.

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

Recommended Posts

Posted

Does anyone know what's the function that sets a touch menu so that only the owner of the attachment will activate it? A very helpful person helped me write this basic script that hides/shows certain prims of a worn attachment through a menu (for example, "hide base", "hide tubes", "show all", etc), but currently when I wear the attachment anyone can just click on my attachment then activate the menu, and hide/show my attachment parts.

Here is the format of her script:

touch_start(integer total_number) 
  {
    ToucherID = llDetectedKey(0);
    listen_id = llListen( channel_dialog, "", ToucherID, "");
    llDialog(ToucherID, msg, choices, channel_dialog);
    llSetTimerEvent(responsetime); 
  }
 
  listen(integer channel, string name, key id, string choice)
   { 
   llSetTimerEvent(0.0);
    if (choice == "Done") 
    {
     llListenRemove(listen_id); 
     return;
    }
    else if (choice == "hide all")
    {
        llSetLinkAlpha( LINK_SET, 0.0, ALL_SIDES );
        batshow = FALSE;
        tubeshow = FALSE;
    }
    else if (choice == "show all")
    {
        llSetLinkAlpha( LINK_SET, 1.0, ALL_SIDES );
        batshow = TRUE;
        tubeshow = TRUE;

...
...

 

Posted

Or:

touch_start(integer total_number)
{
    if ( llDetectedKey(0) == llGetOwner())
    {
        listen_id = llListen( channel_dialog, "", llGetOwner(), "");
        llDialog( llGetOwner(), msg, choices, channel_dialog);
        llSetTimerEvent(responsetime);
    }
}
Posted

Thank you both.

Simple and works perfectly.

On a related note, is there an article in the wiki about access list? For example, prevent anyone except [john smith, jane doe, bob joe] from accessing the menu?

Posted

 

Suki Hirano wrote:

Thank you both.

Simple and works perfectly.

On a related note, is there an article in the wiki about access list? For example, prevent anyone
except
[john smith, jane doe, bob joe] from accessing the menu?


http://wiki.secondlife.com/wiki/LlKey2Name shows how you would obtain the name of the detected key. Than it's simply a matter of comparison with your black list.

 

If your black list gets too long though, you may find it easier to maintain a white list of allowed agent names.

Posted

Well the blacklist is everyone except those 3 people in SL. Basically I'm building one of those things where if someone clicks an emote through a menu it'll say something in local chat like "Jane Doe poked you on the tail!". But only a few people are allowed to touch the attachment.

Posted


Suki Hirano wrote:

Well the blacklist is everyone except those 3 people in SL. Basically I'm building one of those things where if someone clicks an emote through a menu it'll say something in local chat like "Jane Doe poked you on the tail!". But only a few people are allowed to touch the attachment.

 

So, as Leprekhan says, create a whitelist instead.

You are about to reply to a thread that has been inactive for 4243 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
×
×
  • Create New...