I can't save my tables in .txt =/
local id = string.Replace( ply:SteamID(), "." , "_" )
if !file.Exists("ag/"..string.lower(id)..".txt") then
local name = string.Replace( ply:SteamID(), ".", "_" )
local t = {id = ply:SteamID(), xp = 0, rank = 1, money = 0}
file.Write( "ag/"..name..".txt", util.TableToKeyValues(t) )
ply:SetNetworkedInt("rank", 1)
ply:SetNetworkedInt("xp", 0)
ply:SetNetworkedInt("money", 0)
else
print("Found profile for "..ply:Nick())
local name = string.Replace( ply:SteamID(), ".", "_" )
local read = util.KeyValuesToTable( file.Read( "ag/"..name..".txt") )
ply:SetNetworkedInt( "xp", read.xp)
ply:SetNetworkedInt( "rank", read.rank)
ply:SetNetworkedInt( "money", read.money)
end