11.07.2015 Views

Linden Scripting Language Guide - Engineering Center

Linden Scripting Language Guide - Engineering Center

Linden Scripting Language Guide - Engineering Center

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 5. States}state TimerState{state_entry(){// set a timer event for 5 seconds in the future.llSetTimerEvent(5.0);}timer(){llSay(0, "timer");state ListenState;}}state_exit(){// turn off future timer events.llSetTimerEvent(0.0);}integer g_listen_control;state ListenState{state_entry(){// listen for anything on the public channelg_listen_control = llListen(0, "", NULL_KEY, "");}listen(integer channel, string name, key id, string message){llSay(0, "listen");state TimerState;}}state_exit(){// turn off the listenerllListenRemove(g_listen_control);}The state_exit() handler is not called when an object is being deleted - all callbacks, handlers, sounds, etc, willbe cleaned up automatically for you.19

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!