SHARE
TWEET

Untitled

a guest Jul 24th, 2012 17 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. init(key av)
  2. {
  3.     llRequestPermissions(av,PERMISSION_TAKE_CONTROLS);
  4.     llTakeControls( CONTROL_FWD | CONTROL_BACK | CONTROL_LEFT | CONTROL_RIGHT ,TRUE,TRUE);
  5. }
  6.  
  7. default
  8. {
  9.     state_entry()
  10.     {
  11.         if (llGetAttached())
  12.         init(llGetOwner());
  13.     }
  14.    
  15.     attach(key av)
  16.     {
  17.         if (av)
  18.         {
  19.             init(av);
  20.         }
  21.     }
  22.    
  23.     control(key id ,integer held, integer change)
  24.     {
  25.         vector key_held_vector=<!!(held & CONTROL_FWD) - !!(held & CONTROL_BACK),!!(held & CONTROL_LEFT) - !!(held & CONTROL_RIGHT),0.>;
  26.        
  27.         if (llGetAgentInfo(llGetOwner()) & AGENT_IN_AIR)
  28.         llSetForce(ZERO_VECTOR,FALSE);
  29.         else
  30.         llSetForce( (-llVecNorm(key_held_vector)*120 - <0,0,1>)*llGetMass(),TRUE);
  31.     }
  32. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top