Jump to content

Please help with my hud


Cat Tamatzui
 Share

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

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

Recommended Posts

Hi I have a hud with a menu in it the send a message to a prim to tell it to display 3 words afk,brb and busy but it only works for me, but it will work again if someone rezzes out the hud and makes copy of it on the ground then picks it up and wears it will then work and I have no idea why its doing this, its like its locked to me until they rez and make their own copy.

Any help would be much appreciated 

Here is my script for the menu hud.

 

list Pickemote = ["CLOSE","AFK", "BRB", "BUSY"];
string msg = "Please make a choice.";
 
key ToucherID;
integer channel_dialog;
integer chan;
integer listen_id; 
default{
  state_entry() {
    channel_dialog = ( -1 * (integer)("0x"+llGetSubString((string)llGetKey(),-5,-1)) );
    chan = (integer)("0xF" + llGetSubString(llGetOwner(),0,6));
  }
 
  touch_start(integer total_number) {
    ToucherID = llDetectedKey(0);
    llDialog(ToucherID, msg,Pickemote, channel_dialog);
    listen_id = llListen( channel_dialog, "", ToucherID, "");
    llSetTimerEvent(60); 
  }
 
 
  listen(integer channel, string name, key id, string choice) { 
    if (choice == "") {
     llDialog(ToucherID, msg,Pickemote, channel_dialog); 
    }
    else if (choice == "AFK") {
        llRegionSay(chan, "pafk");
        llListenRemove(listen_id);
    }
    else if (choice == "BRB") {
        llRegionSay(chan, "pbrb");
        llListenRemove(listen_id);
   }
    else if (choice == "BUSY") {
        llRegionSay(chan, "pbusy");
        llListenRemove(listen_id);
   }
   else {
        //do something else.
        llListenRemove(listen_id);
    }
 
  }
 
  timer() { //TIME’S UP!
    llListenRemove(listen_id);
    llWhisper(0, "Sorry. You snooze; you lose.");
    llSetTimerEvent(0.0);
  }
}
 

Link to comment
Share on other sites

seems that the receiver object is listening on: chan = (integer)("0xF" + llGetSubString(llGetOwner(),0,6)); When we give the receiver object to another person then that receiver script is reset to listen on chan = the_now_new_owner

this HUD script is not resetting chan when it changes ownership (it does tho when the new owner rezzes the HUD inworld)

the immediate fix is to add a changed event to the HUD script that resets itself when it changes ownership. This will set chan = the_now_new_owner
 

changed(integer change)
{
   if (change & CHANGED_OWNER)
      llResetScript();
}

 

  • Like 5
Link to comment
Share on other sites

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