I am trying to write a script to make secrets activate after a certain time, repeatedly if so wished. This is my first script.
In any case, the script isn't compiling:
ffc script TimedSecrets { // The script will activate secrets after 'frames' number of frames (set as D0). // If D1 is set, it will repeat it as many times as specified. // It will also play the sound specified in D2 void run (int frames, int repeat, int sound) { // If repeat is above 0, then it will repeat that many times if (repeat > 0) { while(repeat > 0){ Waitframes(frames); Screen->TriggerSecrets(); Game->PlaySound(sound) this->repeat -= 1 } } // If repeat is not above 0, then it will repeat indefinitely else if (repeat = 0) { While(true) { Waitframes(frames); Screen->TriggerSecrets(); Game->PlaySound(sound) } } } }
The error that ZC states is this:
Line 1181 (that's the first while loop): SYNTAX ERROR, UNEXPECTED IDENTIFIER, EXPECTING SEMICOLON OR OR, ON TOKEN THIS.
Anyway, I can't find what's wrong with my syntax, and even though I know it's got to be something minor, I'm asking for help.