Advertisement
Guest User

Untitled

a guest
Nov 23rd, 2014
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.51 KB | None | 0 0
  1. onJoin = function(id)
  2.     local file = io.open("sys/lua/testio/"..player(id,"usgn")..".txt", "r")
  3.     if not file then
  4.         local file = io.output(io.open("sys/lua/testio/"..player(id,"usgn")..".txt", "w+"))
  5.         file:write(player(id,"name"))
  6.         msg2(id,"\169255000000Save file not found")
  7.         file:flush()
  8.         file:close()
  9.     else
  10.         msg2(id,"Save file found") -- gonna read the name of the player later
  11.         file:flush()
  12.         file:close()
  13.     end
  14. end
  15.  
  16. addhook("join","onJoin")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement