Search the Community
Showing results for tags 'toggle'.
-
Hi everyone. I'm new to LSL and scripting. I want to make a single button HUD that simply toggles the alpha of a prim attachment I created. To be clear, this attachment is made up of 5 prims and want a button to hide it and reveal it each time I click it. Thank you in advance.
-
Hi! I've written a script that starts on touch_start. After starting the script, the touch_start event is supposed to be deactivated for some time, so that nobody can restart the script as long as the process has not been finished: integer on; touch_start (integer num) { if(!on) { on = TRUE; *do something* } else { return; } This seems to work (the only thing I'm not quite sure about is the "else" part with "return". Couldn't you just leave the "else" part out?) Now my main question: I've tried a similar version, which does NOT work, and I don't really understand the difference: integer on; default { state_entry() { on = FALSE; touch_start (integer num) { if(on = FALSE) { on = TRUE; *do something* } else { return; } } } } The problem apparently is that "!on" and "on = FALSE" don't seem to be the same thing. Could one of you explain the difference between "!on" and "on = FALSE" to me? (Besides: Is it necessary to declare the integer "on" as FALSE at the beginning? Is integer "on" not FALSE by default before it is turned TRUE?) Thank you very much in advance!
-
Hello. First let me say I'm still pretty new to building, scripting, etc., so I may be a little naive, but... Okay, let me try to explain what I've got so far....First, I have a link set of lights (prims)...each prim has a script that changes to one of a set group of colors. I've added an invisible prim as the root which acts as switch for all of the lights with the same script inside. So each prim color can be changed individually AND they'll all change to the SAME color if the root prim is touched instead. I've also found and added a script that turns the prim "projector" light on and off along with "full bright"....also by touch. This only works in the individual lights, not as a set via the root prim, which I'm fine with. All of this works and works together beautifully. The only thing I'm looking for now is a way to synchronize the color of the projected light with the chosen color of the prim. So if I choose to make all the lights blue, then click them all to "turn them on", I'd like the projector light to turn on blue automatically as well. Not sure if that's even possible...or if it is, whether or not that would conflict with any of the other currently working scripts. But any help or advice....or scripts, lol...would be greatly appreciated. Thank you!
-
I'm unsure why but I cannot press "c" to crouch. I don't have a different keyboard layout or anything and I've tried re-logging to see if that would fix it but it didn't. Does anyone know how to fix that?