Advertisement
ecco7777

CC playerdetector (userfriendly)

Apr 9th, 2016
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. p=peripheral.wrap("back")
  2.  
  3. function fileToTable(file)
  4. if fs.exists(file)~=true then
  5. print("file"..file.." not found")
  6. return(false)
  7. end
  8. fp=fs.open(file,"r")
  9. line={}
  10. i=1
  11. line[i]=fp.readLine()
  12. if line[i]==nil then return(false) end
  13. while line[i]~=nil do
  14. i=i+1
  15. line[i]=fp.readLine()
  16. end
  17. return(line)
  18. end
  19.  
  20. while true do
  21. user, player = os.pullEvent("player")
  22. print(player)
  23. user=fileToTable("users")
  24. i=1
  25. while user[i]~=nil do
  26. if player==user[i] then
  27. rs.setOutput("right",true)
  28. sleep(5)
  29. rs.setOutput("right",false)
  30. sleep(0.2)
  31. end
  32. i=i+1
  33. end
  34. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement