Jump to content

Owner Only Item Use?


Tah Crazyboi
 Share

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

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

Recommended Posts

For the record, the original question was:

==========================

Im trying to script an item to only be clickable by the owner, but it doesn't seem to be functioning. I have a couple version that compile properly but for some reason other avatars can still click the items and use them, which is a problem since the items are one time use and self-delete after a second.  So far this is what I have.

default

{
   touch_start(integer num_detected)
    {
        key owner = llGetOwner();
        key touchingAvatar = llDetectedKey(0);
        if (owner == touchingAvatar)
        llPlaySound(llGetInventoryName(INVENTORY_SOUND,0), 1);
         llOwnerSay("Text");
        llSleep(1.3);
        llDie();
    }
}

 

I really don't script and have pieced this much together in several formats following other scripts I've seen or have, and most function perfectly, but I seem to be missing something or several somethings here. Any help would be appreciated.

=================

You're almost there.  All you need is a pair of brackets to define what actions are supposed to be affected by the if test:

    if (owner == touchingAvatar)
	{
        llPlaySound(llGetInventoryName(INVENTORY_SOUND,0), 1);
        llOwnerSay("Text");
        llSleep(1.3);
        llDie();
	}

 

  • Like 2
Link to comment
Share on other sites

LOL

This isn't questions.  How rude of people to ask questions in the LSL forum rather than in Questions.

AND Madelaine asks another question!

AND Snugs answers a question instead of pointing out that you shouldn't ask questions here.

I'm so upset.

In the forums you could edit your original post to be something completely different.  Which I did frequently.  Although it's not helpful.

 

  • Like 1
Link to comment
Share on other sites

On 4/30/2017 at 8:51 AM, Qwalyphi Korpov said:

LOL

This isn't questions.  How rude of people to ask questions in the LSL forum rather than in Questions.

AND Madelaine asks another question!

AND Snugs answers a question instead of pointing out that you shouldn't ask questions here.

You're joking, right?

Edited by Love Zhaoying
Reformat quote
Link to comment
Share on other sites

In response to the OP's question, ask the prim who it belongs to, and it should tell you if you're the owner. But ask nice or it'll spoot particles every time you teleport. Then you're stuck with it until you can give it away as a freebie.

It's a tragic thing, really.

Link to comment
Share on other sites

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