Join us in Outworldz at www.outworldz.com:9000 or follow us:

Search dozens of selected web sites for OpenSim and LSL script

New! Script Meta-Search will search thousands of scripts here and at other sites for LSL or Opensim scripts.
Loading

Want to add a script or a project? Upload it and a half million people will see it and your name here this year.

Home   Show All
Category: Contributor: Creator
Collision Shrink-on-collide  

Shrink-on-collide

Makes a plant or other object shrink when collided with, like Pandora plants

Category: Collision
By : Ferd Frederix
Created: 2014-07-15 Edited: 2014-07-15
Worlds: Second Life

the Zip file

Download all files for Shrink-on-collide
Contents are in zip format, with .LSL (text) source code and LSLEdit (text + Solution) formats.
Get file # 1. Script.lsl

This script by Ferd Frederix may be used in any manner, modified, and republished.  Unless specified otherwise, my scripts are always free and open source.  Objects made with these scripts may be sold with no restrictions.  All I ask is that you point others to this location should they ask you about it and to not sell this script, unless it is for $0 L. Please help improve my work by reporting bugs and improvements.

1
2
3 // tunable numbers
4 float time = 10.0; // stay small 1`0 seconds
5 float small = 0.1; // small scale is 10%
6 vector large;
7
8
9
10 shrink()
11 {
12 vector smallsize = large * small;
13 llSetScale(smallsize);
14 llSetTimerEvent(time);
15 }
16
17
18 default
19 {
21 {
22 large = llGetScale(); // remember the initial size
23 llVolumeDetect(TRUE); // makes it phantom and collidable
24 }
25
26 touch_start(integer total_number)
27 {
28 shrink();
29 }
30
31 collision_start(integer total_number)
32 {
33 shrink();
34 }
35 timer()
36 {
37 llSetScale(large);
39 }
40 }

Back to the Best Free Tools in Second Life and OpenSim.