Here's a little script tip for you! (Well, it's more like a small tutorial which I have plenty on my website (Oddy.nl) but here we go!)
Let's build a very simple elevator!
I provide the scripts, you provide the hard work (and a animation. You definitely need an animation!)
Le scripts
The header of the main script says this:
So I think it's safe to use these scripts here// From the book
//
// Scripting Recipes for Second Life
// by Jeff Heaton (Encog Dod in SL)
// ISBN: 160439000X
// Copyright 2007 by Heaton Research, Inc.
//
// This script may be freely copied and modified so long as this header
// remains unmodified.
//
// For more information about this book visit the following web site:
//
// http://www.heatonresearch.com/articles/series/22/
First thing you want to do is to download these set of scripts. Unpack them to a convenient place on your PC.
Go ahead, download that shizzle and unpack it on your nizzle...
The files inside the Zip file are 6 scripts. You can open them with any text editor, but I prefer notepad++ (http://notepad-plus-plus.org/download/v6.5.5.html)
Le building of ze elevateur <=Say this with an Inspector Clouseau voice...
Un: Build a floor for your elevator (2x2 meters is fine.)
Deux: Build a poseball above this floor, add an animation and the 'Poseball Script' from the zip file. Make sure the animation plays correct (Rotation, height, etc) so you stand or sit on the right spot. Link this prim to the floor. (In Edit mode, hold shift key on your keyboard and touch the floor. Then hit CTRL-L to link the poseball to the floor.)
Trois: Create 2 buttons, name one button up, and the other button down. Place the "elevator button up" script in the Up button, and the "elevator button down" script in the down button. Link these 2 buttons to the floor.
Quatre: Place your elevator on the lowest floor. (Tip: try to place it on a round number, something like 22.0000 meters.) Open the "Elevator Main Script" with a text-editor and look for the line:
Code: Select all
float BOTTOM = 23.02081;
Now raise the elevator to the next floor, again, try to keep the numbers round, e.g. 32.0000 meters (=10 meters higher then floor 1)
Search in the "Main Elevator Script" for the next line:
Code: Select all
float FLOOR_HEIGHT = 23.79401;
Sooooooo, if your elevator floor has 22m as floor 1 and you want it to move up to 32m change float_HEIGTH to 10.
Happy with the numbers?
OK, since we were working in notepad (or any other text editor (Don't use wordpad though, that might give errors!)) copy the script from notepad to a new script in your inv. Place this new script in the elevator floor.
Cinq: It really sucks when you are standing on floor 1 and the elevator is on floor 2! You want a button to press so the darn thing goes down! (or up if you happen to stand on floor 2 and the elevator is on on floor 1)
Create 2 buttons, don't link them to the elevator.
Place one button on floor 1 and put the "elevator call button down" script in it.
place one button on floor 2 and put the "elevator call button up" script in it.
Et voilà, we ave un elevateur..
Sit on the poseball, touch a button and off you go!
Good luck!