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
Weapons Cannon  

Cannon

Cannon

Category: Weapons
By : Encog Dod
Created: 2010-01-10 Edited: 2010-01-10
Worlds: Second Life

the Zip file

Download all files for Cannon
Contents are in zip format, with .LSL (text) source code and LSLEdit (text + Solution) formats.
Get file # 1. Cannon_1.lsl
1 // From the book:
2 //
3 // Scripting Recipes for Second Life
4 // by Jeff Heaton (Encog Dod in SL)
5 // ISBN: 160439000
6 X// Copyright 2007 by Heaton Research, Inc.
7 //
8 // This script may be freely copied and modified so long as this header
9 // remains unmodified.
10 //
11 // For more information about this book visit the following web site:
12 //
13 // http://www.heatonresearch.com/articles/series/22/
14
15 key target;
16 integer countdown;
17
18 default
19 {
21 {
22 llSitTarget(<0,0,0.1>,ZERO_ROTATION);
23 llSetText("Sit here to\nbe fired from the cannon!", <0.0, 1.0, 0.0>, 1.0);
24 }
25
26 timer()
27 {
28 llSay(0,"Cannon will fire in " + (string)countdown + " seconds.");
29 countdown--;
30 if( countdown<0 )
31 {
33 llPushObject(target, <0,0,2147483647>, ZERO_VECTOR, FALSE);
34 }
35 }
36
37 changed(integer change)
38 {
39
40 if(change & CHANGED_LINK)
41 {
42
43 key agent = llAvatarOnSitTarget();
44
45 if(agent)
46 {
47 countdown = 10;
48 target = agent;
49 llUnSit(target);
51 }
52 }
53 }
54 }

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