Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

llListen for group only

MartFader Schwager
Registered User
Join date: 11 Aug 2008
Posts: 2
10-28-2009 03:53
Hi scripters,

Been trying to figure this out for some time now but cant seem to find the right answer. Maybe for some of you this would be an easy task, I myself have just been starting with scripts these past weeks.

My question: Is it possible for a script, which is listening to a specific channel, to check if that channel which is beeing used is beeing used by someone that belongs to a specific group or the same group that the object is linked to?

Hope to get a solving answer on this one. :)

Thanks in advance,


MartFader
Niall Braveheart
Registered User
Join date: 5 Oct 2008
Posts: 27
10-28-2009 04:05
Try this in the listen event

As long as the person "speaking" has the same active group as the listening object
the listener will do whatever it's been programed to do, otherwise it will immedietly exit


CODE

listen( integer channel, string name, key id, string message )
{
if (llSameGroup(id) != TRUE)
{
//exit if user does not have same active group as the object
return;
}

// act on listener here
}
Ee Maculate
Owner of Fourmile Castle
Join date: 11 Jan 2007
Posts: 919
10-28-2009 04:06
You can get the key of who/what you have heard and run it through llSameGroup

http://wiki.secondlife.com/wiki/LlSameGroup

Sorry... just got into work so can't elaborate more now, but hopefully this is enough to get you started?

Edit: Niall just beat me! :D
MartFader Schwager
Registered User
Join date: 11 Aug 2008
Posts: 2
@ Niall Braveheart
10-28-2009 04:23
Thanks a lot for your quick reply! I have added the string you provided and it works great.

Thanks a lot for you help! :)