Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Group, All and Owner Access to menu

Lile Villota
Registered User
Join date: 12 Sep 2007
Posts: 2
11-05-2007 22:35
I'm using a menu in a onject to rez stuff around the object.

I'd like to make the owner able to set access to the menu all, group or owner only, via the dialog menu. If that's not possible or to complicated (which for me is probably the case) I'd like to simply have 3 versions fo the script.

I have an all access script, but every combination of code I've tried gives me an error.

Here's the code:
CODE


list Christmas = ["TreeDecor"];
list TreeDecor = ["Small Decor","Large Decor"];

string massage = "Christmas";

integer channel;
integer menu_handler;
default
{
state_entry()
{
channel = (integer)(llFrand(99999.0) * -1);
llSetTouchText("Decorate");
menu_handler = llListen(channel,"","","");
}

touch_start(integer total_number)
{
llDialog(llDetectedKey(0), "Merry Christmas!", Christmas, channel);
}

listen(integer channel, string name, key id, string message)
{
if (message =="TreeDecor")
llDialog(id,"
Select...", TreeDecor, channel);

if(message == "Small Decor")
{
llDialog(id, "
Select...", TreeDecor, channel);
llSay(25, "small");
}

if(message == "Large Decor")
{
llSay(25, "large");
llDialog(id, "
Select decorations for your tree...", TreeDecor, channel);
}
}
on_rez(integer start_param)
{
llResetScript();
}
}


Thanks so much for taking a look!
Twisted Pharaoh
if ("hello") {"hey hey";}
Join date: 24 Mar 2007
Posts: 315
11-05-2007 22:48
This will get you started:

list Christmas = ["TreeDecor"];
list TreeDecor = ["Small Decor","Large Decor"];

string massage = "Christmas";

integer channel;
integer menu_handler;

key owner ;

integer is_owner ;
integer is_group ;
integer is_other ;

default
{
state_entry()
{
channel = (integer)(llFrand(99999.0) * -1);
llSetTouchText("Decorate";);
menu_handler = llListen(channel,"","","";);
}

touch_start(integer total_number)
{
key toucher ;

toucher = llDetectedKey(0) ;
is_owner = FALSE ;
is_group = FALSE ;
is_other = FALSE ;

if (toucher == llGetOwner())
{
is_owner = TRUE ;
}
else if (llDetectedGroup(0))
{
is_group = TRUE ;
}
else
is_other = TRUE ;

llDialog(llDetectedKey(0), "Merry Christmas!", Christmas, channel);
}

listen(integer channel, string name, key id, string message)
{
if (message =="TreeDecor";)
llDialog(id,"Select...", TreeDecor, channel);

if(message == "Small Decor";)
{
llDialog(id, "Select...", TreeDecor, channel);
llSay(25, "small";);
}

if(message == "Large Decor";)
{
llSay(25, "large";);
llDialog(id, "Select decorations for your tree...", TreeDecor, channel);
}
}
on_rez(integer start_param)
{
llResetScript();
}
}