Jump to content
  • 0

What I thought was a simple move script has me stomped.


Alan Lock
 Share

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

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

Question

I'm working on creating an object with a part that raises up or lowers down when a button is pressed.  I've pieced it together from several other scripts, it compiles but when the command is given nothing happens.

Prim script:

// Show Hide script

integer iSwitch ;

default 
{
    state_entry() 
    {
        key owner = llGetOwner();
        llListen(253465,"", owner, "MENU");
    }
    listen (integer channel, string name, key id, string message)
    {
        iSwitch = !iSwitch;
        
        if ( iSwitch == TRUE)
        {
            llSetPos(llGetPos() + <0,0,0.5>);
        }
        
        else if ( iSwitch == FALSE)
        {
            llSetPos(llGetPos() + <0,0,-0.5>);
        }
    }
}

 

Button Script:

default
{
    touch_start(integer total_number)
    {
      llSay(253465, "MENU");
    }
}
 

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

Specifying owner in llListen will make your prim script listen only to the owner (the avatar that owns the object). But what you need is the script to listen to the button, so that's why it was not working. If you (assuming you are the owner) said "/253465 MENU" in local chat (without quotes), then it would work.

Removing that owner from llListen will make the prim script listen to any object and any avatar and will make it work with the button.

Edited by tomm55
Link to comment
Share on other sites

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