|
Nichiren Dinzeo
Registered User
Join date: 14 Feb 2007
Posts: 203
|
03-16-2007 10:24
I have an object that I want to have Detect a avatars group and if they do not belong to the group they are not allowed to see the notecard inside and get a msg saying sorry. From a prior thread we got the script below. Unfortunately, the object now does not have a Touch option when you right click. Nor does the default (touch/grab on left-click) seem to work. default { touch_start(integer count) { integer i; for ( i = 0 ; i < count ; ++i ) { key who = llDetectedKey(i); if ( who == llGetOwner() || (llDetectedGroup(i) && ! llSameGroup(NULL_KEY)) ) { // do stuff } else { llSay(0, "Sorry, " + llDetectedName(i) + ", this object may only be used by group members. If you are a member of the group, switch your active group tag to it."  ; } } } }
|
|
Meade Paravane
Hedgehog
Join date: 21 Nov 2006
Posts: 4,845
|
03-16-2007 10:33
You can use [ php] and [ /php] (without the spaces) to make the code come out looking nice.. default { touch_start(integer count) { integer i; for ( i = 0 ; i < count ; ++i ) { key who = llDetectedKey(i); if ( who == llGetOwner() || (llDetectedGroup(i) && ! llSameGroup(NULL_KEY)) ) { // do stuff } else { llSay(0, "Sorry, " + llDetectedName(i) + ", this object may only be used by group members. If you are a member of the group, switch your active group tag to it."); } } } } If you're saying that the Touch option isn't available, /me bets that somehow the script has been set to Not Running.. I think you should lose the "&& ! llSameGroup(NULL_KEY)" part of the if statement - the wiki says llSameGroup(llDetectedKey(0))) is the same as llDetectedGroup(0) and I'm not sure that SameGroup(NULL) will ever return TRUE. The way LL did group stuff is weird, IMO. Is the object that contains this script set to a group?
|
|
Nichiren Dinzeo
Registered User
Join date: 14 Feb 2007
Posts: 203
|
?
03-16-2007 10:43
Thanks...not sure that answers the question regarding why the object does not have a Touch option avail for any avatar that want to touch it.
|
|
Meade Paravane
Hedgehog
Join date: 21 Nov 2006
Posts: 4,845
|
03-16-2007 10:45
Er.. From: Meade Paravane If you're saying that the Touch option isn't available, /me bets that somehow the script has been set to Not Running.. So.. If the script has been set to Not Running, the Touch option won't be available when people right-click it.
|
|
Nichiren Dinzeo
Registered User
Join date: 14 Feb 2007
Posts: 203
|
thanks
03-16-2007 11:49
I ended up creating a new object and not it does allow the Owner to see the notecard. We tested it with a different avatar with active group selected and with or without a group selection they are not able to touch the object. Not sure why..the code looks right.. any idea? default { touch_start(integer count) { integer i; for ( i = 0 ; i < count ; ++i ) { key who = llDetectedKey(i); if ( who == llGetOwner() || (llDetectedGroup(i) && ! llSameGroup(NULL_KEY)) ) { llGiveInventory(llDetectedKey(i),"SLGeocache"  ;// do stuff } else { llSay(0, "Sorry, " + llDetectedName(i) + ", this object may only be used by group members. If you are a member of the group, switch your active group tag to it."  ; } } } }
|
|
Meade Paravane
Hedgehog
Join date: 21 Nov 2006
Posts: 4,845
|
03-16-2007 11:56
I've heard, maybe in one of the replies above, that if the script isn't set to running - you know that little checkbox at the bottom of the script edit window that says "Running" - then people won't get the Touch option they right-click on it.
And, your if statement still says "&& ! llSameGroup(NULL_KEY)) )" which I still bet doesn't do anything.
And, if you put [ php] and [ /php] around your code, it will be much easier for people to read..
|
|
Nichiren Dinzeo
Registered User
Join date: 14 Feb 2007
Posts: 203
|
ok
03-16-2007 14:22
ok thx... I will be sure to put php round the code for posts. I didn't understand that statement earlier  My script is running..little box checked.....the problem is that for any avatar whether they have their group set active to the objects group or not they are unable to get the notecard.... need to figure out how any avatar that belongs to the same group as the object can get the notecard
|
|
Nichiren Dinzeo
Registered User
Join date: 14 Feb 2007
Posts: 203
|
need sleep
03-16-2007 14:52
I have been up to long... this was fixed by removing ! ..as probably mentioned above..thx
|