Genki Posted May 15, 2015 If you have a room with 4 switches and a door, and you want to click them in the right order to open the door, what is the correct script for that? say the layout looks something like this: ----Sw3----Sw4----Dr----Sw1----Sw2---- You start with Sw1,Sw2,Sw3,Sw4. And if the player clicks wrongly a monster appears in "spot5" Thanks. 0 Share this post Link to post
scifista42 Posted May 16, 2015 int seqVar = 1; // global variable (map scope) SCRIPT 1 (int tryThisNumber) { // call this script by each switch, with a first parameter = switch number 1-4 if(seqVar<5) { // door is still closed if(tryThisNumber==seqVar) { // expected number in the sequence == number of the switch which was actually pressed seqVar++; // next number for next time if(seqVar==5) { Door_Open(1,16,0); } // sequence complete -> open the door } else { // expected number in the sequence != number of the switch which was actually pressed seqVar = 1; // start over SpawnSpot("DoomImp",5,0,0); // spawn a monster } } } 0 Share this post Link to post
Genki Posted May 16, 2015 Thank you scifista42 :) I Hope it works, seems a little bit complicated. 0 Share this post Link to post