Jump to content

SweetFire Macpherson

Resident
  • Posts

    3
  • Joined

  • Last visited

Reputation

0 Neutral

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. I made the updated but the saw blade still isnt returning to its original position when I press the button to stop it.. Im not sure what the problem is.
  2. Im really new to scripting. That part got cut off in my original post. I found this script on a message similar to this and cleaned it up a bit to work for me. I tried to look up information on using gPos and cant find anything. Is there and exaple somewhere I can look at on how to write this?
  3. script is for a reciprocating saw blade. Press the button and the saw blade moves along the Z axis back and forth. The scripts are placed in two separate objects that are unlinked. Having them unlinked may not be elegant but so far the result of linking them has been problematic. What I am trying to add is when the button is pressed to turn it off I want the saw blade to return to the original position. This is the script I'm using for the button integer COG_CHAN01 = -50001; integer ON_OFF; string MSG_OPTS; float SOUND_VOL = 1; default { touch_start(integer num_detected) { if (ON_OFF == 0) { llSleep(0.5); MSG_OPTS = "Pump"; llSay(0, "Power On"); llSay(COG_CHAN01,MSG_OPTS); ON_OFF = 1; } else { llSleep(0.5); MSG_OPTS = "Stop"; llSay(0, "Power Off"); llSay(COG_CHAN01,MSG_OPTS); ON_OFF = 0; } } } This what I have for the saw blade... integer LISTEN_CHANNEL = -50001; vector pos; integer SWITCH; integer OFFSET = 1; default { state_entry() { pos = llGetLocalPos(); llListen(LISTEN_CHANNEL,"","",""); } listen(integer channel, string name, key id, string message) { llSetTimerEvent( 0.3 * ( SWITCH = !SWITCH ) ); // Alternate SWITCH from 0 to 1 } timer() { pos.x += (0.3 * ( OFFSET *= -1 )); //Alternate OFFSET from 1 to -1 llSetPos(pos); } } I think its as simple as identifying a second object position in the saw script and having some sort of IF statement regarding switch position. Unfortunately I have no idea how to do that given what I already have. Any help appreciated.
×
×
  • Create New...