Jump to content

Detect if an avatar has already touched an object?


i3ulma
 Share

You are about to reply to a thread that has been inactive for 3972 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

I've searched quite a bit for an answer on this already, but hopefully I can get someone's help on here.  Is there a way to detect if an avatar has already touched an object before?  I was hoping I could store the detected keys into a notecard and read each line to see if it matched the detected key, but it looks like writing to notecards can't be done through a script.  So, is there any alternative ways to accomplish this?

Thanks.

Link to comment
Share on other sites

You can't write to a notecard, but that would be a clumsy method anyway.  All you have to do is store the av's UUID or a tokenized version of it in your script's memory.  See http://wiki.secondlife.com/wiki/User:Rolig_Loon/High-Capacity_Greeter-Counter , for example.  The part of that script that you're looking for is in the while loop in the timer event, where it uses llGetAgentInfo to collect the UUIDs of all avatars on the sim at the time.  You could just as easily use that same block of code in a touch_start event to grab the llDetectedKey(0) of an avatar who touches your object.  If you don't anticipate storing a huge amount of information, you could simplify it by just saving llDetectedKey(0) itself instead of compressing it.  

  • Like 1
Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 3972 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...