Take the 2-minute tour ×
Arqade is a question and answer site for passionate videogamers on all platforms. It's 100% free, no registration required.

On my server I have a quiz which you need to take before you can go to most of the areas, build etc... However, sometimes people try to cheat by going with friends into there. I want some kind of gate/mechanism which only allows one player to pass through and insert some kind of delay or so after this. Is this possible? For the delay I know how to make it, I only need to know if you can build something where only one person can pass through, not multiple at once.

share|improve this question
3  
Command blocks would be the closest thing to provide this functionality. You would have to teleport the player, but the problem is knowing which player to teleport. –  MBraedley Nov 16 '12 at 3:00
    
@MBraedley Well, that doesn't really matters... The one who don't gets teleported simply has to wait until the other one finished. –  Andalur Nov 16 '12 at 3:05
1  
@MBraedley You should post that as an answer. It's probably even more solid a solution than mine. –  SevenSidedDie Nov 16 '12 at 4:11
    
What's to prevent people from instant messaging their friends to get the answers? –  John Nov 16 '12 at 13:36
2  
@Andalur I'm confused. I don't see how you're going to set permissions on skype/google chat/cell phone IMing/etc. –  John Nov 16 '12 at 16:04

3 Answers 3

up vote 5 down vote accepted

I think the answer from MBraedley is correct: the best way to handle this scenario (allowing access to a single player at a time) would be to use Command Blocks to teleport one player into and out of your quiz area. You can program a Command Block to teleport the nearest player to a set of coordinates like so:

/tp @p x y z

I don't know what would happen if two players somehow managed to be the exact same distance from the command block (i.e. does just one get teleported, or do they both get teleported since there is a tie for the "closest"). This additional argument may be necessary to limit it to only one player:

/tp @p[c=1] x y z

The next step is to create a circuit whereby clicking an "entry" button will teleport one player into the quiz area, deactivating this button so that it cannot teleport anyone else in until the player exits the quiz area by clicking a second "exit" button, teleporting them out. Here's one such example circuit I just threw together in my survival game:

enter image description here

The blue blocks are buttons that feed their signals into AND gates (green blocks). The outputs of the AND gates will activate Command Blocks (shown here as redstone lamps at the bottom of the image) and will also feed into the input of a T flip-flop circuit (red blocks). The output of the toggle circuit runs behind the red blocks and feeds into an input of each of the AND gates.

When the toggle circuit is in the "off" state (no output, as shown in the image) then the signal from the right button is disabled and the right redstone lamp (i.e. Command Block) cannot be activated. Activating the left button will cause the left redstone lamp to activate and immediately flip the toggle to the "on" state. This will subsequently disable the signal from the left button and reenable the signal from the right button.

This circuit should give you the ability to allow one player at a time to teleport into your quiz area via a button press. Once they reach the end they can then press another button to teleport out and reactivate the entry button for the next player. I'd also suggest enclosing the circuitry and your quiz area in bedrock, so your average player can't mess with any of it.

share|improve this answer
    
The new testfor command is probably useful here. If there is more than 1 person in the test area, teleport them all back to the spawn area. –  MBraedley Mar 15 '13 at 18:10

Iron doors with a button will make them impossible to open until the player passes the quiz and steps on a pressure plate, which will then allow the doors to open again.

share|improve this answer
    
Not if the second player has a button/pressure plate/any other door opening device that can open the door. –  Jeffrey Lin Nov 18 '12 at 1:37

You might want to consider using command blocks to teleport players from a spawn area to the quiz area, and then again to the player area. The reason I'm suggesting teleporting the players into the quiz area is that you only want one player there at a time in order to ensure that the player that finishes the quiz is the player that's teleported to the playing area. There are a few ways to check if a player is still in the quiz area and hasn't, for instance, logged out.

As for how to actually implement this, I have no idea. Obviously, you'll need to have at least op powers so you can spawn the command blocks. Beyond that, I can't give many details.

share|improve this answer
    
You also have to enable command blocks in server.properties - but the line isn't there until you try to use command blocks, which you can give yourself with the /give command. The ID is 137. –  Timtech Jul 26 '13 at 22:00

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.