Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- string question;
- string correctanswer;
- string answer2;
- string answer3;
- string answer4;
- list buttons;
- key touchid;
- integer mchan;
- integer IntValue;
- default
- {
- state_entry()
- {
- mchan = -1 - (integer)("0x" + llGetSubString( (string)llGetKey(), -8, -1) );
- question = "\n" + "What Fish did you caught?";
- llListen(-11223,"","","");
- answer2 = "";
- answer3 = "";
- answer4 = "";
- buttons = [answer2,answer3,answer4];
- }
- listen(integer channel, string name, key id, string msg)
- {
- //Listen for correct answer
- if(channel == -11223)
- {
- IntValue = (integer)msg;
- correctanswer = (string)IntValue;
- answer2 = correctanswer;
- if(answer2 = "1")
- {
- answer2= "Small Fish";
- answer3= "Medium Fish";
- answer4= "Big Fish";
- return;
- }
- else if(answer2 = "2")
- {
- answer2= "Medium Fish";
- answer3= "Small Fish";
- answer4= "Big Fish";
- return;
- }
- else if(answer2 = "3")
- {
- answer2= "Big Fish";
- answer3= "Medium Fish";
- answer4= "Small Fish";
- return;
- }
- }
- if(msg=="Small Fish")
- {
- llSay(0,"you've selected Small Fish");
- }
- else if(msg = "Medium Fish")
- {
- llSay(0,"you've selected Medium Fish");
- }
- else if(msg = "Big Fish")
- {
- llSay(0,"you've selected Big Fish");
- }
- }
- touch_start(integer num_detected)
- {
- touchid = llDetectedKey(0);
- llDialog(touchid, question, buttons, mchan);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement