Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

From Owner use to Group use?

Elhaym Keynes
Registered User
Join date: 17 Apr 2006
Posts: 3
07-10-2006 10:34
I have this cloaking script, it only works for the owner but I know there has to be a way for it to function for everyone or just the group i set it to. could someone help me with this, the script is listed below for reference

default
{
state_entry()
{
key owner = llGetOwner();
llWhisper(0,"open";);
llListen(1,"",owner,"";);
}

listen( integer channel, string name, key id, string message )
{
if( message == "Open" )
{
llSetStatus(STATUS_PHANTOM, TRUE);
llWhisper(0,"Opening";);
llSetAlpha(0,ALL_SIDES);
}
if( message == "Close" )
{
llSetStatus(STATUS_PHANTOM, FALSE);
llWhisper(0,"Closing";);
llSetAlpha(1,ALL_SIDES);
}
}
}
Androclese Torgeson
I've got nothin'
Join date: 11 May 2004
Posts: 144
07-10-2006 12:07
Check out the llSameGroup function. I believe that is exactly what you are looking for.

What you then need to do it check for ownership or check to see if the person using the object is in the same group. (that is what I do anyway)

Hope that helps!
_____________________
Androclese Torgeson

Real Life, also known as "that big room with the ceiling that is sometimes blue and sometimes black with little lights"

Frosty Fox
Registered User
Join date: 28 Feb 2005
Posts: 18
07-10-2006 13:12
this allways helps
CODE
 on_rez(integer no)
{
llResetScript();
}
Bitzer Balderdash
Dazed and Confused
Join date: 21 Dec 2005
Posts: 246
07-11-2006 01:24
llSameGroup is indeed the function that you need, but there are some big caveats to that.

first, the object has to be set to (not deeded, just set to) the group you are interested in, so you will need to re-set that every time you re-rez the item (and it gets weird with attachments *grin*)

and

second, it only scans the active group of an agent, so they have to have their group tag on to use it.
Elhaym Keynes
Registered User
Join date: 17 Apr 2006
Posts: 3
ok so what?
07-12-2006 02:26
ok so I put the ||SameGroup somewhere in the script and it should work right? every time i've tried it says something along the lines of syntax error, perhaps someone could put the copy and pasted script update here so I can see what is meant, I'm sorry for the inconvience it is all so strange to me and quite frustrating that I can't get it right
Bitzer Balderdash
Dazed and Confused
Join date: 21 Dec 2005
Posts: 246
07-12-2006 02:39
from memory, so this could be BAD code *grin*

CODE

touch_start(integer num)
{
if (llSameGroup(llDetectedKey(0)))
{
// toucher is in my group
llSay(0,"hello friend");
}
else
{
// not in my group
llSay(0,"intruder alert!");
}
}


and no, that isn't a complete script, just the touch handler