Quiz Door v1.0
Categories
Linden Script Language | Scripts
Compat
Langage
Ce script posera une question à la personne qui touchera le prim (une porte) le contenant. Une bonne réponse rebdra la porte phantom (franchissable).
OpenSim Lsl Script : Quiz Door v1.0 | |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 |
// Quiz door v1.0 integer CHANNEL_DIALOG_BOX = 99999; list lChoice = ["a", "b", "c"]; key sound = "portal_remember"; float vol = 1; default { state_entry() { llListen(CHANNEL_DIALOG_BOX, "", NULL_KEY, ""); llSetColor(<1.0,1.0,1.0>, ALL_SIDES); } touch_start(integer total_number) { key id = llDetectedKey(0); llDialog(id, " Qui était le principal dirigeant du groupe qui a fondé l'American Psychological Association? a) G. Stanley Hall b) John Dewey c) Carl Rogers Remarque: La rétroaction est affiché en bas à gauche de l'écran sous forme de message de chat. Il n'ya pas de limite de temps et vous avez un nombre illimité de tentatives..", lChoice, CHANNEL_DIALOG_BOX); } listen(integer channel, string name, key id, string message) { if (llListFindList(lChoice, [message]) == 0) { llSay(0, ": Félicitations, votre réponse est correcte, vous pouvez passer!"); llPlaySound(sound, vol); llSetStatus(STATUS_PHANTOM, TRUE); llSetAlpha(0.0,ALL_SIDES); llSleep(10.0); llPlaySound(sound, vol); llSetStatus(STATUS_PHANTOM, FALSE); llSetAlpha(1.1,ALL_SIDES); } if (llListFindList(lChoice, [message]) == 1) { key sound = "portal_active"; llSay(0, "Désolé, mauvaise réponse.. Essayez encore!"); llPlaySound(sound, vol); llSetColor(<1.0,0.0,0.0>, ALL_SIDES); llSleep(0.5); llSetColor(<1.0,1.0,1.0>, ALL_SIDES); } if (llListFindList(lChoice, [message]) == 2) { key sound = "portal_active"; llSay(0, "Désolé, mauvaise réponse.. Essayez encore!"); llPlaySound(sound, vol); llSetColor(<1.0,0.0,0.0>, ALL_SIDES); llSleep(0.5); llSetColor(<1.0,1.0,1.0>, ALL_SIDES); } if (llListFindList(lChoice, [message]) == 3) { // do something here } } } |