Advertisement
Guest User

cg?

a guest
Sep 22nd, 2015
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.73 KB | None | 0 0
  1. local function importhomes(erase_old)
  2.         local input = io.open(old_homes_file, "r")
  3.         if input then
  4.             repeat
  5.                 local x = input:read("*n")
  6.                 if x == nil then
  7.                     break
  8.                 end
  9.                 local y = input:read("*n")
  10.                 local z = input:read("*n")
  11.                 local n = input:read("*l")
  12.                 savehome(n:sub(2), {x=x, y=y, z=z})
  13.             until input:read(0) == nil
  14.             io.close(input)
  15.             if erase_old == "erase" then
  16.                 io.open(old_homes_file, "wb"):write("Homes have been converted to the .phf format"..
  17.                                 " and stored in the /players directory of the world directory")
  18.                 return true, "Home files imported and old file was erased!"
  19.             end
  20.             return true, "Home files imported!"
  21.         else
  22.             return false, "ERROR IMPORTING HOMES!!!"
  23.         end
  24.     end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement