Jump to content

kawolf

Resident
  • Posts

    5
  • Joined

  • Last visited

Posts posted by kawolf

  1. Hi all,

    am having a problem with the following script it detects the name of the avi and says it ok.

    but at the give object part

    even tho its said the name above it still gives error message
            llGiveInventory: Can't parse destination key 'avi name'

    I've also tried it using id2=Detectedkey(0)

    any help would be appreciated

     

    integer score;
    integer CHANNEL = -1234567890;
    string id2;
    default
    {
        touch_start(integer num_detected)
        {
            id2=llDetectedName(0);
            llSay(0,id2);//say name of avi using this line to check it worked
            score = 0;
         

      llListen(CHANNEL,"", NULL_KEY, "");
        }    
          
           listen(integer CHANNEL, string name, key id, string message) //lISTENS TO A DIFFERENT SCRIPT HERE
     {
         if ( message == "hit")
            {
             score=score+1;
              }
         if (score == 5)
         
    {
      

     llSay(0,"THATS THE LOT");
       
            integer randomIndex = llGetInventoryNumber(INVENTORY_OBJECT);
            //  random >> [0.0, max)
            randomIndex = (integer)llFrand(randomIndex);
            string itemName = llGetInventoryName(INVENTORY_OBJECT, randomIndex);
      
            llSay(0, id2);even tho its said the name above
           

            llGiveInventory(id2, itemName);//it still gives error message  llGiveInventory: Can't parse destination key 'avi name' here
           

             llSay(0,"Giving");
              
        }
    }} //END

  2. Thanks for the advice everyone after tinkering round and playing with the ideas i finally got it to work,thats what i ended up with:))

    // in the listener
    integer points = 0;
    integer totalpoints = 0;
    integer message;
    default
    {
    touch_start(integer total_number)
    {



    llListen(-5869, "red", "", "");
    llListen(-5870, "green", "", "");
    llListen(-5871, "blue", "", "");
    llListen(-5872, "yellow", "", "");
    llListen(-5873, "white", "", "");
    llSetTimerEvent(240);

    }
    listen(integer channel, string name, key id, string message)
    {

    if(message) { totalpoints += (integer)message;}
    }
    timer()
    {

    llSay (0, "total points= " + (string)totalpoints);
    llSleep(2);
    llResetScript();
    }
    }

     

  3. Below is a script im trying to debug but not having much luck, ive made a target rezzer that rezzes 5 different coloured balls on  timed delay, each ball will take a max number of hits before it sends its score to the main listener and then self deletes. the script below is in the listener/rezzer, what im trying to do is get it to add all the reported scores together and then say a total in the main chat. A little help would be appreciated.

     

     

     

     

    //inthelistener
    //5 different unlinked objects report a number on 5 different channels
    //how to take those 5 numbers and add them together to make listener object report a total
    // llShout(-5872,(string)points+"");reported by each object just ondifferent channel

    integer totalpoints = 0;//points = 0 at start
    integer points = 0;
    default
    {
    state_entry()
    {
    llListen(-5869, "red", "", "");//nameoffirstobject
    llListen(-5870, "green", "", "");//nameofsecondobject
    llListen(-5871, "blue", "", "");//nameofthirdobject
    llListen(-5872, "yellow", "", "");//nameoffourthobject
    llListen(-5873, "white", "", "");//nameoffifthobject
    }
    listen(integer channel, string name, key id, string message)
    {
    totalpoints = points + message;
    }
    {
    llSleep(190);//amount of time from 1st object reporting to last object reporting + 5 secs
    llSay (0, "total points=" +totalpoints);
    llSleep(2);
    llResetScript();
    }

×
×
  • Create New...