Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Set to group only

Jojo Naxos
Registered User
Join date: 26 Nov 2008
Posts: 2
11-26-2008 12:31
Hello,

i have an object with a script that shows a menu. but i cant seem to set it to group only access. This means i want only members of a group that i have to be able to see the menu.. other people can see the object.. but when they touch it.. nothing happens.. i hope you get what i mean.. thank you
Jeredin Denimore
Romani Ite Domum
Join date: 5 Jul 2008
Posts: 95
11-26-2008 12:53
From: Jojo Naxos
Hello,

i have an object with a script that shows a menu. but i cant seem to set it to group only access. This means i want only members of a group that i have to be able to see the menu.. other people can see the object.. but when they touch it.. nothing happens.. i hope you get what i mean.. thank you


You'd want to do the following in your touch_start event:

CODE

touch_start(integer num_detected)
{
integer i;
for (i = 0; i < num_detected; i++)
{
if (llSameGroup(llDetectedKey(i)))
{
// dialog goes here
}
}
}


Assuming the clicked prim with the script is also set for the same group.
Anti Antonelli
Deranged Toymaker
Join date: 25 Apr 2006
Posts: 1,091
11-26-2008 12:54
Your object presents the menu when it is clicked, right?

In your script there will be a section something like this that looks for clicks:
(ignore the [ PHP ] stuff if you see it, it's only for forum formatting)

CODE


touch_start(integer num_detected)
{
** a bunch of stuff related to presenting the menu **
}



Add something like this:

CODE


touch_start(integer num_detected)
{
if (llDetectedGroup(0) == TRUE)
{
** stuff related to presenting the menu **
}
}


Then all the stuff that happens on a click will only happen if the person is wearing the group tag for the same group the object is set to.

edit: oops, too slow. Oh well, a couple of slightly different approaches here, can't be a bad thing :)

edit2: Jeredin added some code that allows for multiple people clicking at the same time, a very good idea. Follow his lead :D
_____________________
Designer of sensual, tasteful couple's animations - for residents who take their leisure time seriously. ;)

http://slurl.com/secondlife/Brownlee/203/110/109/

Jeredin Denimore
Romani Ite Domum
Join date: 5 Jul 2008
Posts: 95
11-26-2008 12:57
From: Anti Antonelli
edit: oops, too slow. Oh well, a couple of slightly different approaches here, can't be a bad thing :)


Amen brother :)
Jojo Naxos
Registered User
Join date: 26 Nov 2008
Posts: 2
11-26-2008 13:00
cool

that worked very well.. thank you :)