Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- integer Touched;
- integer listen_handle;
- integer chan = -90;
- key Toucher;
- Dialog()
- {
- llListenRemove(listen_handle);
- listen_handle = llListen(chan, "", Toucher, "");
- llSetTimerEvent(120.0);
- llDialog(Toucher,"\nSelect an option:",["Play","Stop"],chan);
- }
- default
- {
- touch_end(integer num)
- {
- Toucher = llDetectedKey(0);
- Dialog();
- }
- listen(integer channel, string name, key id, string msg)
- {
- if(channel == chan)
- {
- if(msg == "Play")
- {
- if(!Touched)
- {
- Touched = TRUE;
- llPlaySound(llGetInventoryName(INVENTORY_SOUND, 0), 1.0);
- Dialog();
- }
- else
- {
- Dialog();
- }
- }
- else if(msg == "Stop")
- {
- Touched = FALSE;
- llStopSound();
- llListenRemove(listen_handle);
- }
- }
- }
- timer()
- {
- llListenRemove(listen_handle);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement