Override TTT function

I am trying to remove all edits from the core TTT files and make the overrides in addon format. This last function is giving me some problems and I can’t seem to come up with a solution. Any help would be very much appreciated!

local function PrintDamageLog(ply)
local pr = GetPrintFn(ply)

if (not IsValid(ply)) or ply:IsSuperAdmin() or GetRoundState() != ROUND_ACTIVE or (ply:IsAdmin() and not ply:Alive()) then
– ServerLog(Format("%s used ttt_print_damagelog
“, IsValid(ply) and ply:Nick() or “console”)) --Returns error, more concerned about line:12
pr(”*** Damage log:

  if not dmglog_console:GetBool() then
     pr("Damage logging for console disabled. Enable with ttt_log_damage_for_console 1.")

  for k, txt in ipairs(GAMEMODE.DamageLog) do      --Returns error here

  pr("*** Damage log end.")

if IsValid(ply) then
pr(“You do not appear to be RCON or a superadmin, nor are we in the post-round phase!”)
concommand.Add(“ttt_print_damagelog”, PrintDamageLog)

[ERROR] addons/Overrides/lua/autorun/client/cl_ttt_overrides.lua:12: bad argument #1 to ‘ipairs’ (table expected, got nil)

From my quick glance at the code, GAMEMODE.DamageLog is a server side variable declared at line 189 of init.lua. From what I can tell you are trying to use a server variable in a client lua state.

How embarrassing, for some reason I was thinking this was a client-side script for TTT. I ended up moving this function to a server side file and now it’s telling me ‘ttt_print_damagelogs is a unknown command’

Any ideas?

Because the command is called ttt_print_damagelog maybe?

Thanks, but that was just a typo in my post.


EDIT: Can you post the function?

Jesus Christ I woke up today and it seems to be working. I haven’t done a god damn thing between yesterday and today. Looks like I wasted 3-4 hours for nothing =D