Difference between revisions of "LlAgentInExperience"

From Second Life Wiki
Jump to navigation Jump to search
(Created page with "Category:Experience Tools {{LSL_Function |func=llAgentInExperience |func_desc=Determines whether or not the agent is in the script's experience. |func_footnote=Returns TRUE i…")
 
m (Replaced <source> with <syntaxhighlight>)
 
(8 intermediate revisions by 3 users not shown)
Line 1: Line 1:
[[Category:Experience Tools]]
[[Category:Experience Tools]]
{{LSL_Function
{{LSL_Function
|inject-2={{LSL_Function/avatar|agent|sim=*}}
|func=llAgentInExperience
|func=llAgentInExperience
|func_desc=Determines whether or not the agent is in the script's experience.
|func_desc=Determines whether or not the specified {{LSLPT|agent}} is in the script's experience.
|func_footnote=Returns TRUE if the agent is in the experience and the experience can run in the current region.
|func_footnote
|return_type=integer
|return_type=integer
|return_subtype=boolean
|return_text=that is [[TRUE]] if the {{LSLPT|agent}} is in the experience and the experience can run in the current region.
|caveats=*Agent must be over a parcel that has the Experience allowed or FALSE is returned with Land Scope Experience compiled scripts.
|p1_type=key
|p1_type=key
|p1_name=agent
|p1_name=agent
|p1_desc=Key of the agent to query
|p1_desc=&#32;to query.
|also_functions=
|also_functions=
*[[llGetExperienceDetails]]
*[[llGetExperienceDetails]]
*[[llGetExperienceList]]
|examples=<syntaxhighlight lang="lsl2">
|examples=<lsl>default
default
  {
{
      touch_start(integer total_number)
  touch_start(integer total_number)
      {
  {
          if(llAgentInExperience(llDetectedKey(0)))
    if(llAgentInExperience(llDetectedKey(0)))
          {
    {
              llOwnerSay(llDetectedName(0)+ " is not in my experience");
      llOwnerSay(llDetectedName(0)+ " is in my experience");
              llRequestExperiencePermissions(llDetectedKey(0), "");
    }
          }
    else
          else
    {
          {
      llOwnerSay(llDetectedName(0)+ " is not in my experience");
              llOwnerSay(llDetectedName(0)+ " is in my experience");
    }
              llClearExperiencePermissions(llDetectedKey(0));
  }  
          }
}</syntaxhighlight>
      }  
|cat1=Experience
  }</lsl>}}
}}

Latest revision as of 03:20, 5 May 2024

Summary

Function: integer llAgentInExperience( key agent );

Determines whether or not the specified agent is in the script's experience.
Returns a boolean (an integer) that is TRUE if the agent is in the experience and the experience can run in the current region.

• key agent avatar UUID that is in the same region to query.

Caveats

  • Agent must be over a parcel that has the Experience allowed or FALSE is returned with Land Scope Experience compiled scripts.

Examples

default
{
  touch_start(integer total_number)
  {
    if(llAgentInExperience(llDetectedKey(0)))
    {
      llOwnerSay(llDetectedName(0)+ " is in my experience");
    }
    else
    {
      llOwnerSay(llDetectedName(0)+ " is not in my experience");
    }
  } 
}

See Also

Deep Notes

Signature

function integer llAgentInExperience( key agent );