Would this work?



function Player( ply )
	local name = ply:Name()
	local SteamID = ply:SteamID()
	local ip = ply:IPAddress()
	print( "Player Connected. Name: " .. name .. " SteamID: " .. SteamID .. " IP: " .. ip )


end
hook.Add("PlayerConnected", "Player", "Player")


I am just asking because I can’t test it right now.
I am kinda new in Lua but would THIS work:

[lua]
function PlayerConnected( ply )
local name = ply:Name()
local SteamID = ply:SteamID()
print( name, SteamID )
file.Write( “Player” + name + “.txt”, name, SteamID )

end
[/lua]

The first one would not work because of the last … on the longest line ( syntax error )
The second one would not work because you are trying to use Java operations in Lua, and you got the arguments for file.Write wrong.

And keep in mind that you will need to call the function from somewhere, or hook it up with hook.Add.

Oh. Okay. But how would it look like.

Here’s an example of how to write to a file, create new files, read from a file and alter a file contents: https://dl.dropboxusercontent.com/u/26074909/tutoring/files/creating_files_with_numerically_incrementing_titles_and_saved_index.lua.html

The file.Write arguments are as follows: filename_and_path, data_to_write, starting_path_string( such as “DATA”, “Lua”, “GAME”, “mod”, etc… )