Got an iPhone or iPad? We have a brand new Pastebin App for both devices, and it's totally free! Click here to download the new Pastebin App for iOS.

AggroHUD lesson2

By: bdhtrn on Oct 11th, 2011  |  syntax: Linden Scripting  |  size: 1.67 KB  |  hits: 115  |  expires: Never
download  |  raw  |  embed  |  report abuse
Copied
  1. vector ZV=ZERO_VECTOR;
  2. rotation ZR=ZERO_ROTATION;
  3. integer mode=1;
  4. integer ch=13;
  5.  
  6. default{
  7.     state_entry(){
  8.         llListen(ch,"",llGetOwner(),"");
  9.     }
  10.     touch_start(integer num){
  11.         if(mode==1){
  12.             vector whereami=llGetPos()+<1.8,0,1.6>*llGetRot();
  13.             vector FWOOSHH=llRot2Fwd(llGetRot())*55;
  14.             rotation aim=llEuler2Rot(<90,0,90>*DEG_TO_RAD);
  15.             llRezObject("dissed",whereami,FWOOSHH,aim,0);
  16.         }
  17.     }
  18.     touch(integer num){
  19.         if(mode==2){
  20.             vector whereami=llList2Vector(llGetObjectDetails(
  21.                 llGetOwner(),[OBJECT_POS]),0)+<0,0,0.34>;
  22.             float Xoff = (llFrand(0.7)-0.35)*1.4;
  23.             float Yoff = (llFrand(0.7)-0.35)*1.4;
  24.             float Zoff = (llFrand(0.7)-0.35)*1.4;
  25.             vector nowwhere=whereami+<Xoff,Yoff,Zoff>;
  26.             integer ranchan=(integer)(llFrand(100000000)-1000000000);
  27.             integer wat = (integer)llFrand(10)+1;
  28.             float colR = llFrand(1);
  29.             float colG = llFrand(1);
  30.             float colB = llFrand(1);
  31.             llRezObject("ball",nowwhere,ZV,ZR,ranchan);
  32.             llSay(ranchan,(string)<colR,colG,colB>);
  33.         }
  34.     }
  35.     listen(integer chan,string who,key id,string msg){
  36.             // Mode Changers
  37.         if(msg=="blox")
  38.             mode=1;
  39.         else if(msg=="ball")
  40.             mode=2;
  41.  
  42.             // Rezzers
  43.         else if(msg=="plat")
  44.             llRezObject("platfrm",llGetPos()-<0,0,1>,ZV,ZR,0);
  45.         else if(msg=="sand")
  46.             llRezObject("sandbx",llGetPos()-<0,0,1>,ZV,ZR,0);
  47.         else if(msg=="noclip")
  48.             llRezObject("npv",llGetPos(),ZV,ZR,0);
  49.     }
  50. }
  51.