Advertisement
NuAoA

Untitled

Jun 8th, 2013
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. -- Death Logger 0.1
  2. -- By: NuAoA
  3.  
  4. if not fs.exists("wrap") then
  5. print("wrap API not found, downloading from http://pastebin.com/g5tBarus")
  6. shell.run("pastebin get g5tBarus wrap")
  7. end
  8. os.loadAPI("wrap")
  9. chat = wrap.attach("chat")
  10. function recordDeaths
  11. while true do
  12. local event,player = os.pullEvent("chat_death")
  13. local prev = ""
  14. if fs.exists("death.data") then
  15. local file = fs.open("death.data","r")
  16. prev = file.readAll()
  17. file:close()
  18. end
  19. local file = fs.open("death.data","w")
  20. file.write(player)
  21. file.write("\n")
  22. file.write(prev)
  23. file.close()
  24. end
  25. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement