Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local function importhomes(erase_old)
- local input = io.open(old_homes_file, "r")
- if input then
- repeat
- local x = input:read("*n")
- if x == nil then
- break
- end
- local y = input:read("*n")
- local z = input:read("*n")
- local n = input:read("*l")
- savehome(n:sub(2), {x=x, y=y, z=z})
- until input:read(0) == nil
- io.close(input)
- if erase_old == "erase" then
- io.open(old_homes_file, "wb"):write("Homes have been converted to the .phf format"..
- " and stored in the /players directory of the world directory")
- return true, "Home files imported and old file was erased!"
- end
- return true, "Home files imported!"
- else
- return false, "ERROR IMPORTING HOMES!!!"
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement