| integer
totalNum
=
3; integer currentNum = 1; string currentdigit; string digit1 = "one"; string digit2 = "two"; string digit3 = "three"; setNumber() { if (currentNum == 1) { currentdigit = digit1; } else if (currentNum == 2) { currentdigit = digit2; } else if (currentNum == 3) { currentdigit = digit3; } llSay(0, currentdigit); } default { state_entry() { llSetText("Touch Ratchet",<1,1,1>,1.0); } touch_start(integer total_number) { currentNum += 1; if (currentNum > totalNum) currentNum = 1; setNumber(); } } |
| //Teleport
v2.01 by Pablo Pharmanaut //based on old SL TP script by Cubey Terra integer totalPos = 5; //This integer should equal total number of positions integer currentPos = 1; string currentpos; vector vPos1 = <190.824,168.0,41>; //These are vectors for the positions to vector vPos2 = <221.0,99.5,24>; //which you wish to teleport vector vPos3 = <128.0,128.0,40>; vector vPos4 = <45,85,81>; vector vPos5 = <45,85,91>; string sPos1 = "house"; //name of positions, if desired. This helps string sPos2 = "waterfront"; //you to know where you are going! string sPos3 = "entry point"; string sPos4 = "Scriptwerks Level 2"; string sPos5 = "Scriptwerks Level 3"; vector currentvPos; setPos() { if (currentPos == 1) { currentpos = sPos1; currentvPos = vPos1; } else if (currentPos == 2) // { // add or delete this section of script to change currentpos = sPos2; // number of TP destinations. Change currentPos currentvPos = vPos2; // integer to number of destinations. } // else if (currentPos == 3) { currentpos = sPos3; currentvPos = vPos3; } else if (currentPos == 4) { currentpos = sPos4; currentvPos = vPos4; } else if (currentPos == 5) { currentpos = sPos5; currentvPos = vPos5; } //add else if section here with higher currentPos integer to add TP destinations. //Don't forget to increase totalPos integer at top of script vector pos = llGetPos(); llSetText("Teleport to "+currentpos+"\nTouch me to change destination",<1,1,1>,1.0); vector offset = currentvPos - pos; llSitTarget(offset, ZERO_ROTATION); } default { state_entry() { llSetSitText("Teleport"); //This changes HUD display from "Sit" to "Teleport" } touch_start(integer total_number) { currentPos += 1; if (currentPos > totalPos) currentPos = 1; setPos(); } } |