Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Make this menu owner or group only

Lunar Tripsa
Registered User
Join date: 2 Feb 2007
Posts: 38
09-21-2007 18:27
Hi, I'm not a scriptor, but I managed to work out a menu script that does exactly what I want with one thing..
Ideally i wanted to put a permission notecard in it to so that the owner could name names of people who could access the menu, but from the reading I've done that's way over my head as is a menu option similar to the MLP group and owner only settings.

So I figured I'd just have diffrent scripts, one for each setting, all, group and user. Problem is I haven't been able to edit the script to make it group or owner only. I'm hoping it's something extremely simple that I'm missing.

Any help would be greatly apprciated as this is the last step in a project and I can't wait to finish it.

CODE

integer menu_handler;
integer menu_channel;

menu(key user,string title,list buttons)//make dialog easy, pick a channel by itself and destroy it after 5 seconds
{
menu_channel = (integer)(llFrand(99999.0) * -1);//yup a different channel at each use
menu_handler = llListen(menu_channel,"","","");
llDialog(user,title,buttons,menu_channel);
llSetTimerEvent(5.0);
}

default
{
state_entry()
{ llSetTouchText("Decorate");
}
touch_start(integer t)
{
menu(llDetectedKey(0),"
CODE
Kenn Nilsson
AeonVox
Join date: 24 May 2005
Posts: 897
09-21-2007 19:01
Owner Only:

CODE

integer menu_handler;
integer menu_channel;

menu(key user,string title,list buttons)//make dialog easy, pick a channel by itself and destroy it after 5 seconds
{
menu_channel = (integer)(llFrand(99999.0) * -1);//yup a different channel at each use
menu_handler = llListen(menu_channel,"","","");
llDialog(user,title,buttons,menu_channel);
llSetTimerEvent(5.0);
}

default
{
state_entry()
{
llSetTouchText("Decorate");
}
touch_start(integer t)
{
if(llDetectedKey(0) == llGetOwner()) menu(llDetectedKey(0));
}
CODE


Group Only

CODE

integer menu_handler;
integer menu_channel;

menu(key user,string title,list buttons)//make dialog easy, pick a channel by itself and destroy it after 5 seconds
{
menu_channel = (integer)(llFrand(99999.0) * -1);//yup a different channel at each use
menu_handler = llListen(menu_channel,"","","");
llDialog(user,title,buttons,menu_channel);
llSetTimerEvent(5.0);
}

default
{
state_entry()
{
llSetTouchText("Decorate");
}
touch_start(integer t)
{
if(llDetectedGroup(0) == TRUE) menu(llDetectedKey(0));
}
CODE


The change is just adding simple "if" statements testing for whether the avatar is part of the same group (must have group tag currently active) or if the avatar is the object owner.
_____________________
--AeonVox--

Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms chasing ghosts, eating magic pills, and listening to repetitive, addictive, electronic music.
Lunar Tripsa
Registered User
Join date: 2 Feb 2007
Posts: 38
09-21-2007 19:14
Ohhh thank you!!! Perfect, works like a charm!

Thanks agian!!!