Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

police car listening to avatars hud

Mrc Homewood
Mentor of Randomness
Join date: 24 Feb 2007
Posts: 779
05-08-2008 21:16
im trying to script up a hud to a police car i made, here is how it is in my head

avatar sits in car
car begins to listen
avatar "on" the seat presses a hud button
lights turn on/off ect
avatar gets out
car stops listing to avatar on seat

but the hud dosent wont to work anyone have any idea how to make it work for a hud that the avatar is wearing?


CODE

integer hanndle;

changed(integer change)
{
if (change & CHANGED_LINK)
{
key agent = llAvatarOnSitTarget();
if (agent)
{
if(llSameGroup(llDetectedKey(0)) == TRUE)
{
hanndle = llListen(0,"","","");
}
else
{
llUnSit(llAvatarOnSitTarget());
}
}
else
{
llListenRemove(hanndle);
}
}
}
listen(integer channel, string name, key id, string message)
{
if (llAvatarOnSitTarget()) // how to make it listen to avatar on sittargets hud
{
if(message == "lightson")
{
llMessageLinked(LINK_ALL_CHILDREN, 0,"lightson", "");
}
else if(message == "lightsoff")
{
llMessageLinked(LINK_ALL_CHILDREN, 0,"lightsoff", "");
}
}
}
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
05-08-2008 21:23
Please see notes on the use of llGetOwnerKey() in the thread /54/b4/257817/1.html