From fb8faa8336ddb795ccd6840259b06a2608350a57 Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Mon, 12 Jan 2009 18:00:46 +0000 Subject: * Apply http://opensimulator.org/mantis/view.php?id=2913 * Add the KanEd scripts to the standard library * Thanks Fly-Man- --- bin/assets/ScriptsAssetSet/KanEd-Test02.lsl | 31 +++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 bin/assets/ScriptsAssetSet/KanEd-Test02.lsl (limited to 'bin/assets/ScriptsAssetSet/KanEd-Test02.lsl') diff --git a/bin/assets/ScriptsAssetSet/KanEd-Test02.lsl b/bin/assets/ScriptsAssetSet/KanEd-Test02.lsl new file mode 100644 index 0000000..2506d95 --- /dev/null +++ b/bin/assets/ScriptsAssetSet/KanEd-Test02.lsl @@ -0,0 +1,31 @@ +integer counter; + +default +{ + state_entry() + { + llSay( 0, "Hello, Avatar! Touch to change color and size."); + counter = 0; + } + + touch_start(integer total_number) + { // do these instructions when the object is touched. + counter = counter + 1; + + // choose three random RGB color components between 0. and 1.0. + float redness = llFrand( 1.0 ); + float greenness = llFrand( 1.0 ); + float blueness = llFrand( 1.0 ); + + // combine color components into a vector and use that vector + // to set object color. + vector prim_color = < redness, greenness, blueness >; + llSetColor( prim_color, ALL_SIDES ); // set object color to new color. + + // choose a random number between 0. and 10. for use as a scale factor. + float new_scale = llFrand(10.0) + 1.0; + llSetScale(< new_scale, new_scale, new_scale > ); // set object scale. + llSay( 0, "Touched by angel number " + (string)counter); + } +} + -- cgit v1.1