Jump to content

vehicle script, chat command


Doctor Visage
 Share

You are about to reply to a thread that has been inactive for 1552 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

hello! i am trying to make a script for vehicle which triggers an action by local chat command (on channel 0). but if its two or more same vehicles standing nearby - it will trigger them all? also if someone else says that command, they all will listen and be triggered?

how to avoid it and make it listen to only owner's chat command and only the one i am sitting in?

Edited by Doctor Visage
Link to comment
Share on other sites

When you set up a listener with llListen, you're also creating an initial chat filter.

llListen(channel, name, id, msg);

If the message doesn't come from name or id, and doesn't contain msg, no listen event will happen.

If those filters pass and a listen event is triggered, you can ignore any that aren't from the owner:

if (id != llGetOwner()) return;

And you can ignore any that don't come from avatars sitting on the same object:

if (id != llAvatarOnSitTarget()) return;
if (id != llAvatarOnLinkSitTarget(link)) return;

 

  • Thanks 1
Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 1552 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...