<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://wiki.osgrid.org/index.php?action=history&amp;feed=atom&amp;title=LlAvatarOnSitTarget</id>
	<title>LlAvatarOnSitTarget - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://wiki.osgrid.org/index.php?action=history&amp;feed=atom&amp;title=LlAvatarOnSitTarget"/>
	<link rel="alternate" type="text/html" href="http://wiki.osgrid.org/index.php?title=LlAvatarOnSitTarget&amp;action=history"/>
	<updated>2026-10-25T11:12:17Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.11</generator>
	<entry>
		<id>http://wiki.osgrid.org/index.php?title=LlAvatarOnSitTarget&amp;diff=65&amp;oldid=prev</id>
		<title>Osgridadmin: /* Function: key llAvatarOnSitTarget( ); */</title>
		<link rel="alternate" type="text/html" href="http://wiki.osgrid.org/index.php?title=LlAvatarOnSitTarget&amp;diff=65&amp;oldid=prev"/>
		<updated>2017-12-30T16:02:24Z</updated>

		<summary type="html">&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;Function: key llAvatarOnSitTarget( );&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==Function: key llAvatarOnSitTarget( );==&lt;br /&gt;
Returns a key that is the UUID of the user seated on the prim.&amp;lt;br&amp;gt;&lt;br /&gt;
If the prim lacks a sit target or there is no avatar sitting on the prim, then [[NULL_KEY]] is returned.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Caveats&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
• A prim does not have a sit target unless [[llSitTarget]] has been called with a nonzero vector as the first argument.&amp;lt;br&amp;gt;&lt;br /&gt;
• If the prim lacks a sit target or the avatar is seated upon a different prim, the only way to determine how many and which avatars are seated upon the object is to scan the link set (for an example of this, see [[llGetNumberOfPrims]]). &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Examples&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
{|border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|&amp;lt;source lang=&amp;quot;lsl&amp;quot;&amp;gt;&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        // set sit target, otherwise this will not work &lt;br /&gt;
        llSitTarget(&amp;lt;0.0, 0.0, 0.1&amp;gt;, ZERO_ROTATION);&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    changed(integer change) {&lt;br /&gt;
        if (change &amp;amp; CHANGED_LINK) { &lt;br /&gt;
            key av = llAvatarOnSitTarget();&lt;br /&gt;
            if (av) {//evaluated as true if not NULL_KEY or invalid&lt;br /&gt;
                llSay(0, &amp;quot;Hello &amp;quot; + llKey2Name(av) + &amp;quot;, thank you for sitting down&amp;quot;);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Useful Snippets&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
{|border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|&amp;lt;source lang=&amp;quot;lsl&amp;quot;&amp;gt;&lt;br /&gt;
//Gets the link number of a seated avatar&lt;br /&gt;
integer GetAgentLinkNumber(key avatar)&lt;br /&gt;
{&lt;br /&gt;
    integer linkNum = 1 + llGetNumberOfPrims();&lt;br /&gt;
    key linkKey;&lt;br /&gt;
    //Next we get the linkKey and make sure it&amp;#039;s not null, if it&amp;#039;s null we are done.&lt;br /&gt;
    while((linkKey = llGetLinkKey( --linkNum )))//is the key valid?&lt;br /&gt;
        if(avatar == linkKey)//is it the avatar we want?&lt;br /&gt;
            return linkNum;//It&amp;#039;s the avatar we want so return.&lt;br /&gt;
    //avatar wasn&amp;#039;t not found&lt;br /&gt;
    //return a number that isn&amp;#039;t a LINK_* flag not a valid link number either.&lt;br /&gt;
    return 0x7FFFFFFF;//max int.&lt;br /&gt;
}//Written by Strife Onizuka&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Notes&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
The position of an avatar on a sit target can be determined with the use of llGetObjectDetails (see llSitTarget for an example). &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See Also &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Events&amp;#039;&amp;#039;&amp;#039; &amp;lt;br&amp;gt;&lt;br /&gt;
•  	[[changed]] 	&amp;lt;br&amp;gt;		&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Functions&amp;#039;&amp;#039;&amp;#039; &amp;lt;br&amp;gt;&lt;br /&gt;
•  	[[llSitTarget]] 		&amp;lt;br&amp;gt;	&lt;br /&gt;
•  	[[llGetLinkKey]]		&amp;lt;br&amp;gt;	&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Articles&amp;#039;&amp;#039;&amp;#039; &amp;lt;br&amp;gt;&lt;br /&gt;
•  	[[CHANGED_LINK]] 	&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Osgridadmin</name></author>
	</entry>
</feed>