Suki Hirano Posted April 21, 2013 Posted April 21, 2013 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; ... ...
Jack Jaehun Posted April 21, 2013 Posted April 21, 2013 place in touch_start: see: http://lslwiki.net/lslwiki/wakka.php?wakka=llDetectedKey if (llDetectedKey(0) == llGetOwner()) { }
Dora Gustafson Posted April 21, 2013 Posted April 21, 2013 Or: touch_start(integer total_number) { if ( llDetectedKey(0) == llGetOwner()) { listen_id = llListen( channel_dialog, "", llGetOwner(), ""); llDialog( llGetOwner(), msg, choices, channel_dialog); llSetTimerEvent(responsetime); } }
Suki Hirano Posted April 21, 2013 Author Posted April 21, 2013 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?
LepreKhaun Posted April 22, 2013 Posted April 22, 2013 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.
Suki Hirano Posted April 22, 2013 Author Posted April 22, 2013 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.
Rolig Loon Posted April 22, 2013 Posted April 22, 2013 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.
Recommended Posts
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