1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
--//save functions and other
function array(m,v)
	local t={}
	for i=1,m do
		t[i]=v
	end
	return t
end
function SaveTableToFile(tbl,filename)
	file=io.open(filename,"w+")
	for i=1,#tbl do
		file:write(tbl[i].."\n")
	end
	file:close()
end
function LoadFileToTable(tbl,filename,clear)
	if clear==nil then clear=false end
	if clear==true then tbl={} end
	file=io.open(filename,"r")
	if file~=nil then
		for line in file:lines() do
			table.insert(tbl,line)
		end
		file:close()
	else
		print("File:'"..filename.."' not found!")
	end
end
--//variables
texts=array(32,{})
--//game functions
addhook("say","OnSay")
function OnSay(id,txt)	
	if player(id,"usgn")>0 then
		table.insert(texts[id],txt)
		SaveTableToFile(texts[id],"sys/lua/saves/"..player(id,"usgn")..".txt")
	end
end
addhook("join","OnJoin")
function OnJoin(id)	
	LoadFileToTable(texts[id],"sys/lua/saves/"..player(id,"usgn")..".txt",true)
end
you need 'saves' folder in sys/lua/