Difference between revisions of "LlAgentInExperience"

From Second Life Wiki
Jump to navigation Jump to search
m
m (Replaced <source> with <syntaxhighlight>)
 
(5 intermediate revisions by 3 users not shown)
Line 8: Line 8:
|return_subtype=boolean
|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.
|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
Line 13: Line 14:
|also_functions=
|also_functions=
*[[llGetExperienceDetails]]
*[[llGetExperienceDetails]]
|examples=<lsl>default
|examples=<syntaxhighlight lang="lsl2">
  {
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");
    {
              llRequestExperiencePermissions(llDetectedKey(0), "");
      llOwnerSay(llDetectedName(0)+ " is in my experience");
          }
    }
          else
    else
          {
    {
              llOwnerSay(llDetectedName(0)+ " is in my experience");
      llOwnerSay(llDetectedName(0)+ " is not in my experience");
          }
    }
      }  
  }  
  }</lsl>
}</syntaxhighlight>
|cat1=Experience
|cat1=Experience
}}
}}

Latest revision as of 04: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.
All Issues ~ Search JIRA for related Bugs

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

Search JIRA for related Issues

Signature

function integer llAgentInExperience( key agent );