1 posts
Posted 02 June 2013 - 06:38 PM
"OpenCCSensors Player Name Output : i need the name of a player when he comes near to my computer (using occs sensors)
8543 posts
Posted 03 June 2013 - 12:53 PM
Split into new topic.
I believe you want the Username key from the detailed info of the target. Use ocs/programs/sensorview to confirm.
35 posts
Posted 05 June 2013 - 11:07 PM
try this
os.loadAPI("ocs/apis/sensor")
prox = sensor.wrap("right") – change to the correct side
while true do
t = prox.getTargets()
for name, details in pairs(t)
if details.Name == "Player" then
local x = prox.getTargetDetails(name)
print(x.Username)
end
end