Log help

So this is my code



function loHoo()
    print("Do I")
    file.CreateDir("test_logs")
    testFile = "test_logs/" .. os.date("%m_%d_%Y %I_%M %p") .. ".txt"
    file.Write(testFile, os.date() .. "	" .. text)
    file.Append(testFile, "
" .. os.date() .. "	" .. (text or ""))
end
hook.Add( "PlayerSay", "chatCommand", loHoo )


Its not even printing Do I, and its not shooting any lua errors, anyone know why or can help me? Please and thank you

Are you running the script on the server?

Yes

Then another hook is probably returning something before your hook is called.

This server only has this thing on it so… I dont know what would be doing it

[editline]2nd September 2017[/editline]

This is so confusing

[lua]
lua_run for k, v in pairs(hook.GetTable().PlayerSay or {}) do local i = debug.getinfo(v) print(k, i.short_src … “:” … i.linedefined) end
[/lua]
Toss that in server console and see what it gives you


> for k, v in pairs(hook.GetTable().PlayerSay or {}) do local i = debug.getinfo(v) print(k, i.short_src .. ":" .. i.linedefined) end...

Is what it gave me

[editline]2nd September 2017[/editline]

So I have made a file to print when the server loads the file, and it never prints anything…

Where’s the file, relative to C:? eg.


C:\Program Files (x86)\Steam\steamapps\common\GarrysMod\garrysmod\lua\autorun\server\something.lua

Got it, it doesnt like loading when the folder is called test

What folder? Where is this file? The name of the folder shouldn’t have anything to do with it.

D:\Servers\Gmod_Test_Server\garrysmod\addons\logger\autorun\server\sv_log.lua < and the file still does nothing

[editline]2nd September 2017[/editline]

OH

[editline]2nd September 2017[/editline]

Aha I forgot to put it in a lua folder

[editline]2nd September 2017[/editline]

Well uh this is solved