Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- integer toggle; //simple integer switch -- has two possible values, 0 (false) and 1 (true)
- default
- {
- state_entry()
- {
- toggle = FALSE;//set toggle to false (by default it is anyway)
- llListen(5,"",llGetOwner(),""); //listen on channel 5 to messages from the owner
- llParticleSystem([]);//start with particles off
- }
- listen(integer channel, string name, key id, string message)
- {
- message = llToLower(message);//convert message to lower case, so we aren't case-sensitive
- if (toggle == TRUE && "off" == message || toggle == FALSE && "on" == message){//if either I'm emitting particles and get the "off" message or not emitting and get the "on" message
- if ("on" == message){
- //do stuff to turn particles on
- }
- else if ("off"==message){
- //do stuff to turn particles off
- }
- toggle =! toggle;//switch the value of toggle
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment