Posted 10 May 2014 - 09:32 PM
Hello everyone,
I have a program that open doors. It uses the getPlayerNames() command. This command detects all players within his range. I only want to detect the name of the nearest player to the sensor. How do I do this?
Thanks in advance,
Len
I have a program that open doors. It uses the getPlayerNames() command. This command detects all players within his range. I only want to detect the name of the nearest player to the sensor. How do I do this?
s = peripheral.wrap("top")
for i,v in pairs(s.getPlayerNames()) do
print(v)
end
-- It detects all players within the range. But how to only detect the nearest?
Thanks in advance,
Len