file.Exists Bad Argument

Hi I am working on an admin mod and it has been fine on gmod 10/11 but on 13 its misbehaving!

function EV.LogEvent(Text)
 local Date = string.gsub("%x"), "/", "-")
 local FName = "EVLogs/"..Date..".txt"
 Text = "(""%X")..") "..Text
 if(file.Exists(FName)) then
  local LastText = file.Read(FName)
  Text = LastText..Text..".
  Text = Text..".
 file.Write(FName, Text)

Which spits out:

Hook 'EV.PlayerInitialSpawn' Failed: [@addons\evo x\lua\ev_core\ev_core.lua:63] bad argument #2 to 'Exists' (string expected, got no value)
 unknown lua\includes\modules\hook.lua:77

Any help?

As your question/request is related to LUA you should consider taking a look at the Facepunch LUA Section. LUA Developers ain’t very active in the Help & Support section so you should try to post a thread in the Question or Request sub-forums of the Facepunch LUA Section!