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
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
--********************-- --*****Initialize*****-- --********************-- logdir = "sys/log" addhook("say","on_say") function on_say(p,logdir,txt,message) local USGN = player(p,"usgn") 	 local pName = player(p,"name") 	 local pIP = player(p,"ip") if(io.open(""..logdir.."/chat.log")~=nil) then 	 for p in io.lines(""..logdir.."/chat.log") do 	 l = p 	 if(l~=nil)then 	 l = readfile(""..logdir.."/chat.log") 	 io.output(io.open(""..logdir.."/chat.log", "w+")) 	 io.write("["..USGN"]--["..pIP"] "..pName": "..message"") 	 io.close() end end end end
I haven't got any error, what do you think?
I just learning LUA and IO file scripting now, so do not insult me about it...