Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

detecting the person who touches a prim

Perwin Rambler
Registered User
Join date: 24 Mar 2005
Posts: 152
05-22-2005 19:44
Hello,

I am trying to make a script where it checks to see if the person touching it is the owner.
If it is the owner, then it performs a function.

I am trying to not use a scan or listen. Is there anything out there that can do this?

can an avatar pass on it's key or name by touching an object?
Ace Cassidy
Resident Bohemian
Join date: 5 Apr 2004
Posts: 1,228
05-22-2005 19:54
The llDetectedKey() function will give you want.

Example code :

CODE

default
{
touch_start(integer num_detected)
{
integer i;
key owner = llGetOwner();

for ( i = 0; i < num_detected; i++ )
{
if ( llDetectedKey(i) == owner )
{
// put whatever you want to happen when the owner touches here
}
}
}
}
_____________________
"Free your mind, and your ass will follow" - George Clinton
Jillian Callahan
Rotary-winged Neko Girl
Join date: 24 Jun 2004
Posts: 3,766
05-22-2005 19:54
Yus. The llDetected* functions work in touch.

In your case:

CODE
touch_start(integer n)
{
if ( llDetectedKey(0) == llGetOwner() ) // Is the first detected toucher's key the same as the owner's key?
{
// If yes, Do Stuff
}
}
_____________________
Perwin Rambler
Registered User
Join date: 24 Mar 2005
Posts: 152
Thank you all so much
05-22-2005 20:03
Thank you.. Every time I come into the forums for help you all are quick to respond.
Thank you, Thank you , Thank You!!!
work great!