LSL Status/Kan-ed8

From OpenSimulator

(Difference between revisions)
Jump to: navigation, search
(New page: '''Code:''' default { state_entry() { llSay( 0, "Hello, Avatar! Touch to launch me straight up."); llSetStatus( 1, TRUE ); // turn on physics. } touch...)
 
m (Robot: Cosmetic changes)
 
(4 intermediate revisions by 4 users not shown)
Line 1: Line 1:
 +
__NOTOC__
 +
{{Quicklinks}}
 +
<br />
 +
 
'''Code:'''
 
'''Code:'''
  
Line 24: Line 28:
 
  }
 
  }
  
'''Status:''' llApplyImpulse() and llSetStatus not implemented. Currently waiting on physics engine to catch up.
+
'''Status:''' Working!
 +
 
 +
[[Category:Scripts]]

Latest revision as of 20:31, 3 March 2012


Code:

default
{
   state_entry()
   {
       llSay( 0, "Hello, Avatar! Touch to launch me straight up.");
       llSetStatus( 1, TRUE );  // turn on physics.
   }

   touch_start(integer total_number)
   {  
       vector start_color = llGetColor( ALL_SIDES ); // save current color. 
       llSetColor( < 1.0, 0.0, 0.0 > , ALL_SIDES );  // set color to red.
       
       float objMass = llGetMass();
       float Z_force = 20.0 * objMass;
       
       llApplyImpulse( < 0.0, 0.0, Z_force >, FALSE );
       
       llSay( 0, "Impulse of " + (string)Z_force + " applied." );
       llSetColor( start_color , ALL_SIDES ); // set color to green.
   }
}

Status: Working!

Personal tools
General
About This Wiki