Advertisement
salahzar

script cannone (che ascolta righelli velocita e angolo)

Feb 17th, 2014
249
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. integer CHANNEL=100;
  2. key ID;
  3.  
  4. float ANGOLO=45;
  5. float MASSA;
  6. float VELOCITA=5;
  7.  
  8. display()
  9. {
  10.     llSetColor(<1,0.6,0.6>,ALL_SIDES);
  11.   llSetRot(llEuler2Rot(<0,DEG_TO_RAD*(90-ANGOLO),0>));
  12.    llSetText("Angolo: "+(string)ANGOLO+",\n Vel: "+(string)VELOCITA,<1,1,1>,1);
  13.     llSetColor(<0.5,0.5,0.5>,ALL_SIDES);
  14. }
  15.  
  16. default
  17. {
  18.     state_entry()
  19.     {
  20.        display();
  21.         llSay(0, "Script running");
  22.         llListen(100,"",NULL_KEY,"");
  23.     }
  24.     listen(integer channel,string name,key id,string str)
  25.     {
  26.         list l=llParseStringKeepNulls(str,[" "],[]);
  27.         string cursore=llList2String(l,0);
  28.         float valore=llList2Float(l,1);
  29.         if(cursore=="angolo") ANGOLO=valore;
  30.         if(cursore=="velocita") VELOCITA=valore;
  31.         display();
  32.        
  33.     }
  34.    
  35.     touch_start(integer count)
  36.     {
  37.           vector vel=<VELOCITA,0,0>;
  38.         rotation novanta=llEuler2Rot(DEG_TO_RAD*<0,90,0>);
  39.         vel*=llGetRot()/novanta;
  40.    
  41.        llRezAtRoot(llGetInventoryName(INVENTORY_OBJECT,0),llGetPos(),vel,llGetRot(),(integer)MASSA);
  42.     }
  43.     object_rez(key id)
  44.     {
  45.         llSay(100,"SIZE "+(string)MASSA);
  46.        
  47.    
  48.     }
  49. }
  50.  
  51.  
  52.  
  53. //////////////////////////////
  54. state lancia {
  55.     state_entry()
  56.     {
  57.         vector vel=<VELOCITA,0,0>;
  58.         rotation novanta=llEuler2Rot(DEG_TO_RAD*<0,90,0>);
  59.         vel*=llGetRot()/novanta;
  60.    
  61.        llRezAtRoot(llGetInventoryName(INVENTORY_OBJECT,0),llGetPos(),vel,llGetRot(),(integer)MASSA);
  62.     }
  63.     object_rez(key id)
  64.     {
  65.         llSay(100,"SIZE "+(string)MASSA);
  66.         llResetScript();
  67.     }
  68.  
  69.     touch_start(integer count)
  70.     {
  71.         llResetScript();
  72.     }
  73. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement