I want to make a teleport command with command blocks that allows only people with certain names to teleport. So basicly its an admin only button and if your name isnt on one of the command blocks you cant teleport, it would also check if the player was in a radius of two blocks. What I have tried is
/tp <player name>[r=2] <coords here> and
/tp @p[name=<player name>,r=2] <coords here> and neither have worked. Is this possible?
The problem I'm having after further experimenting with the same code is when I use the
<player name> to teleport it grabs the right person but it teleports them from anywhere no matter the person who steps on it because the radius doesn't seem to work. and with the other code that uses the
@p variable it has the radius right but I can set the
name property to no one on the server and it still teleports the closest person (it seems to teleport the closest person if it cant find the name, when I want it to teleport nothing if the name is not found). Maybe I need to add some redstone but I don't know if that would help.