Even easier (but more complicated scripting-wise) method:
NPC Code:
if(playerenters){
if(isleader){
setstring server.gamenumber,#v(strtofloat(#s(server.gamenumb er))+1);
//=start a new game-may not be necessary, since it's covered in Victory
} if(strtofloat(#s(gamenumber))<strtofloat(#s(server .gamenumber))){
//=if the player was not previously in this game
setstring gamenumber,#s(server.gamenumber);
//=Set the player's game number to the current game number
timereverywhere;
timeout=0.05; }else{
//=the player was already in this game once
setlevel2 outside.graal,30,30;
//=kick the player out
}
}
if(timeout){
if(strtofloat(#s(gamenumber))<strtofloat(#s(server .gamenumber))){
//=if your game number no longer matches up (ie the game has ended)
setlevel2 outside.graal,30,30;
}else{
if(playerscount=1){
//=you're the only one in the game
if(this.battlebegan>0){
//=there were previously other people in this room
setstring server.gamenumber,#v(strtofloat(#s(server.gamenumb er))+1);
//=set the next game number
this.battlebegan=0;
//=clear that, it's a new game
setstring victories,#v(strtofloat(#s(victories))+1);
//=Add a victory to your scorecard
setlevel victory.graal;
//=kick you to the congratulations level
}
}else{
this.battlebegan=1;
//=remember that there have been more than 1 person in the room }
timereverywhere;
timeout=0.05;
}
}
This will work, poorly, for any one room that you only want a person to be able to enter once per game. It's the same basic idea as the Capture the Flag game, but with a few tweaks. Note also; you can do a much better one with playerdies. If it's absolutely necessary, I'll write that one out too...