Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //
- integer hudchan = -387429; //channel huds communicate on
- integer started;
- default
- {
- state_entry()
- {
- llListen(hudchan,"","","");
- }
- touch_start(integer total_number)
- {
- if (llDetectedKey(0) == llGetOwner())
- {
- if (llDetectedTouchFace(0) == 1)
- {
- if (started == TRUE)
- {
- llOwnerSay("touched buzzer");
- }
- else
- {
- llOwnerSay("you can only buzz in when the quiz buzzer system is started");
- }
- }
- }
- }
- listen (integer channel, string name, key id, string msg)
- {
- list templist = llParseString2List(msg,["#"],[""]);
- key recievedkey = llList2Key(templist,0);
- string command = llList2String(templist,1);
- llOwnerSay("recievedkey: " +(string)recievedkey+ " command: "+command);
- if (recievedkey == llGetCreator())
- {
- if (command == "Start")
- {
- started = TRUE;
- llOwnerSay("quiz buzzer system is now started. You can now buzz in when required by touching the big yellow button on your buzzer hud");
- }
- if (command == "Stop")
- {
- started = FALSE;
- llOwnerSay("quiz buzzer system is now stopped. You can no longer touch the big yellow button to buzz in until the system is started again");
- }
- }
- }
- changed (integer change)
- {
- if (change & CHANGED_OWNER)
- {
- llOwnerSay("new hud owner detected " + llGetUsername(llGetOwner()) + " Welcome to the quiz buzzer system. The big yellow button on your hud is your quiz buzzer, when the sytem is active you can click it to buzz in");
- }
- }
- attach(key id)
- {
- if (id)
- {
- llOwnerSay("hud attached and running");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement