Jump to content
Doctor Visage

vehicle script, chat command

You are about to reply to a thread that has been inactive for 199 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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites
You are about to reply to a thread that has been inactive for 199 days.

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...