Advertisement
Gayngel

Valid Avatar uuid check by raising a dataserver event

Feb 18th, 2022 (edited)
2,026
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. key uuid = "a9ba2797-81af-429d-9833-51127ad5593c";  // add a uuid to check if it is an avatar or not.
  2. key query;
  3.  
  4. default
  5. {
  6.    
  7.  
  8.    state_entry()
  9.     {
  10.         llSetTimerEvent(0.0);
  11.        llSetTimerEvent(3.0);   // begin a timer event for a timeout period. if the timer event triggers the uuid is not an avatar
  12.        
  13.       query = llRequestAgentData(uuid, DATA_NAME); // only a valid avatar uuid will trigger an agent data request query
  14.      
  15.        
  16.     }
  17.    
  18.    
  19.     dataserver(key queryid, string data)
  20.     {
  21.      
  22.      if(queryid == query)  // only a valid avatar uuid will trigger an agent data request query
  23.      {
  24.          llSetTimerEvent(0.0); // since the data request was triggerd, the uuid is an avatar so stop the timer before the timeout.
  25.           llSay(0,(string)uuid +" is an avatar with a name of " + data );  
  26.          
  27.      }  
  28.        
  29.     }
  30.    
  31.     timer()
  32.     {
  33.        
  34.          llSetTimerEvent(0.0);
  35.          llSay(0,(string)uuid +" is not an avatar.");  // if the timer event triggers the uuid is not an avatar
  36.        
  37.     }
  38. }
  39.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement