Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Conditional door/item lock help needed

Humpy Camel
Registered User
Join date: 19 Nov 2007
Posts: 1
12-12-2007 22:48
Hi,
I have searched thru the script libraries and cant find exactly what i need, although i know the script exists..somewhere.

My problem is that i have a TV booth which is for 1 person at a time. however anyone else can walk in and change the TV channel whilst it is being used.
What im looking for is a script that will restrict the door opening and the TV control use to the person that is sat in the viewing chair.

Can anyone help?..or possibly point me in the direction of how to do it?

Thanks in anticipation.
Cid Jacobs
Theoretical Meteorologist
Join date: 18 Jul 2004
Posts: 4,304
12-18-2007 16:46
Use llAvatarOnSitTarget to get the key of the person sitting on the object, if the key is != NULL_KEY then have it check to see if the person touching the door (llDetectedKey(0)) is the same as llAvatarOnSitTarget.
_____________________
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
12-18-2007 23:09
once you have a valid key on the sit target, filter the touch event in both the door and the tv controls (or the listen event depending on your setup)

something like
if (llAvatarOnSitTarget() && keyID == llAvatarOnSitTarget()){
for the tv and
if (!llAvatarOnSitTarget() || keyID == llAvatarOnSitTarget()){
for the door

(yes that was sloppy, save the function call to a variable in the changed event (LINK_CHANGED) and then refrence it in the control if statements)
_____________________
|
| . "Cat-Like Typing Detected"
| . This post may contain errors in logic, spelling, and
| . grammar known to the SL populace to cause confusion
|
| - Please Use PHP tags when posting scripts/code, Thanks.
| - Can't See PHP or URL Tags Correctly? Check Out This Link...
| -