Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

How to tell if it's an object or agent?

Jade Bard
Registered User
Join date: 7 Jul 2004
Posts: 106
06-27-2006 19:57
Does anyone know of a way to figure out if it's an object or agent?

I was figuring you could requestdata on the key, and see if it's online/offline, and i'd assume an object wouldn't return online... but, idk.

Anyone got an idea?
_____________________

Jesse Malthus
OMG HAX!
Join date: 21 Apr 2006
Posts: 649
06-27-2006 20:12
If you're talking about a key, I would use llGetOwnerKey and see if it returns the same key. If it does, then it's an av (I think...).
Jade Bard
Registered User
Join date: 7 Jul 2004
Posts: 106
06-27-2006 20:19
no no

lets just say i'm listening, anyone can say something. [My object is listening.] If it object says something, it'll pick it up just like if an agent said something. How can i tell if it was an object or agent.
_____________________

Rodrick Harrington
Registered User
Join date: 9 Jul 2005
Posts: 150
06-27-2006 20:52
same thing . . .

CODE

listen(integer channel, string name, key id, string message)
{
if (llGetOwnerKey(id) == id) //then it's an avatar
{
//do something
}
else
{
//it's an object so do something else
}
}
_____________________
Mark Gjellerup
Too Much Gjellerup!
Join date: 20 Mar 2006
Posts: 35
llGetOwnerKey won't help...
06-28-2006 02:31
The following comparison is the fastest way to do this and is on the Hacks page of the Wiki:

CODE

if(llGetAgentSize(id) != ZERO_VECTOR)
{
//id is agent
}
else
{
//id is not agent
}
_____________________