function write()
file = fs.open("Blocks","w")
blocks = {}
blocks[1] = {id = 00,name = "air"}
blocks[2] = {id = 01,name = "stone"}
blocks[3] = {id = 02,name = "grass block"}
blocks[4] = {id = 03,name = "dirt"}
blocks[5] = {id = 08,name = "water"}
blocks[6] = {id = 10,name = "lava"}
blocks[7] = {id = 12,name = "sand"}
blocks[8] = {id = 13,name = "gravel"}
blocks[9] = {id = 14,name = "gold ore"}
blocks[10] = {id = 15,name = "iron ore"}
blocks[11] = {id = 16,name = "coal ore"}
blocks[12] = {id = 21,name = "lapis lazuli ore"}
blocks[13] = {id = 24,name = "sandstone"}
blocks[14] = {id = 56,name = "diamond ore"}
blocks[15] = {id = 73,name = "redstone ore"}
blocks[16] = {id = 78,name = "snow"}
blocks[17] = {id = 79,name = "ice"}
blocks[18] = {id = 80,name = "snow block"}
blocks[19] = {id = 82,name = "clay block"}
blocks[20] = {id = 11,name = "mycelium"}
blocks[21] = {id = 120,name = "end portal block"}
blocks[22] = {id = 129,name = "emerald ore"}
blocks[23] = {id = 174,name = "packed ice"}
for i = 1,#blocks do
file.writeLine(blocks[i])
end
file.close()
end
function read()
file = fs.open("Blocks","r")
Blocks = {}
Blocks[1] = file.readLine()
print(Blocks[1])
end
write()
read()
can anyone help help me
the problem i have is not reading it reads fine but it reads the {} in the block i just want it to store into a nested table of id example
Block[1]
id,1
name,Stone
Block[2]
id,2
name,Grass Block