• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • 2026 staff recruitment is open! Check it out and consider applying!

[LUA] Request , Need a code to add it to npc script to make a log.txt file

MohamedRefaat

Marketing and Coding
Premium User
Joined
Jan 18, 2014
Messages
991
Solutions
3
Reaction score
232
Location
Egypt
Hi ,

I want a code to add it to npc script to make a log.txt file which save everything that player say it to npc.

My server is Aries XML 0.4.0

and if there is a code to add it to player file to can save a log for him too ( xml file )

waiting for reply
 
Solution
io.output(io.open("logs/nameoflogfile.txt", "a"))
io.write("insert your text here")
io.close()

As far as doing it for a specific player, you could always make the file name the players name. And this ofc would be added to the creatureSayCallback portion of the npc script. You should however be very careful when using this. If people know you are doing it, they could set a bot to spam the hell out of the npc and explode your log file :D
io.output(io.open("logs/nameoflogfile.txt", "a"))
io.write("insert your text here")
io.close()

As far as doing it for a specific player, you could always make the file name the players name. And this ofc would be added to the creatureSayCallback portion of the npc script. You should however be very careful when using this. If people know you are doing it, they could set a bot to spam the hell out of the npc and explode your log file :D
 
Solution
Back
Top