Fretta lua error

I’m running a PropHunt server which has, since I moved the server from my old server to my new server, began giving me an error, pasted below. When this happens it says “Too many lua errors” , but apparently, it’s not enough to kick off players, so it’s not that urgent, but would be nice to fix. It seems to have to do with notices.



TEST [gamemodes/fretta/gamemode/vgui/vgui_gamenotice.lua][gamemodes/fretta/gamemode/vgui/vgui_gamenotice.lua]
FOUND IN ADDON [0]
TEST [gamemodes/fretta/gamemode/vgui/vgui_hudbase.lua][gamemodes/fretta/gamemode/vgui/vgui_gamenotice.lua]
TEST [gamemodes/fretta/gamemode/vgui/vgui_hudcommon.lua][gamemodes/fretta/gamemode/vgui/vgui_gamenotice.lua]
TEST [gamemodes/fretta/gamemode/vgui/vgui_hudelement.lua][gamemodes/fretta/gamemode/vgui/vgui_gamenotice.lua]
TEST [gamemodes/fretta/gamemode/vgui/vgui_hudlayout.lua][gamemodes/fretta/gamemode/vgui/vgui_gamenotice.lua]
TEST [gamemodes/fretta/gamemode/vgui/vgui_scoreboard.lua][gamemodes/fretta/gamemode/vgui/vgui_gamenotice.lua]
TEST [gamemodes/fretta/gamemode/vgui/vgui_scoreboard_small.lua][gamemodes/fretta/gamemode/vgui/vgui_gamenotice.lua]
TEST [gamemodes/fretta/gamemode/vgui/vgui_scoreboard_team.lua][gamemodes/fretta/gamemode/vgui/vgui_gamenotice.lua]
TEST [gamemodes/fretta/gamemode/vgui/vgui_gamenotice.lua][gamemodes/fretta/gamemode/vgui/vgui_gamenotice.lua]
FOUND IN ADDON [0]
TEST [gamemodes/fretta/gamemode/vgui/vgui_hudbase.lua][gamemodes/fretta/gamemode/vgui/vgui_gamenotice.lua]
TEST [gamemodes/fretta/gamemode/vgui/vgui_hudcommon.lua][gamemodes/fretta/gamemode/vgui/vgui_gamenotice.lua]
TEST [gamemodes/fretta/gamemode/vgui/vgui_hudelement.lua][gamemodes/fretta/gamemode/vgui/vgui_gamenotice.lua]
TEST [gamemodes/fretta/gamemode/vgui/vgui_hudlayout.lua][gamemodes/fretta/gamemode/vgui/vgui_gamenotice.lua]
TEST [gamemodes/fretta/gamemode/vgui/vgui_scoreboard.lua][gamemodes/fretta/gamemode/vgui/vgui_gamenotice.lua]
TEST [gamemodes/fretta/gamemode/vgui/vgui_scoreboard_small.lua][gamemodes/fretta/gamemode/vgui/vgui_gamenotice.lua]
TEST [gamemodes/fretta/gamemode/vgui/vgui_scoreboard_team.lua][gamemodes/fretta/gamemode/vgui/vgui_gamenotice.lua]
TEST [gamemodes/fretta/gamemode/cl_deathnotice.lua][gamemodes/fretta/gamemode/cl_deathnotice.lua]
FOUND IN ADDON [0]
TEST [gamemodes/fretta/gamemode/cl_gmchanger.lua][gamemodes/fretta/gamemode/cl_deathnotice.lua]
TEST [gamemodes/fretta/gamemode/cl_help.lua][gamemodes/fretta/gamemode/cl_deathnotice.lua]
TEST [gamemodes/fretta/gamemode/cl_hud.lua][gamemodes/fretta/gamemode/cl_deathnotice.lua]
TEST [gamemodes/fretta/gamemode/cl_init.lua][gamemodes/fretta/gamemode/cl_deathnotice.lua]
TEST [gamemodes/fretta/gamemode/cl_notify.lua][gamemodes/fretta/gamemode/cl_deathnotice.lua]
TEST [gamemodes/fretta/gamemode/cl_scores.lua][gamemodes/fretta/gamemode/cl_deathnotice.lua]
TEST [gamemodes/fretta/gamemode/cl_selectscreen.lua][gamemodes/fretta/gamemode/cl_deathnotice.lua]
TEST [gamemodes/fretta/gamemode/cl_splashscreen.lua][gamemodes/fretta/gamemode/cl_deathnotice.lua]
TEST [gamemodes/fretta/gamemode/class_default.lua][gamemodes/fretta/gamemode/cl_deathnotice.lua]
TEST [gamemodes/fretta/gamemode/init.lua][gamemodes/fretta/gamemode/cl_deathnotice.lua]
TEST [gamemodes/fretta/gamemode/player_class.lua][gamemodes/fretta/gamemode/cl_deathnotice.lua]
TEST [gamemodes/fretta/gamemode/player_colours.lua][gamemodes/fretta/gamemode/cl_deathnotice.lua]
TEST [gamemodes/fretta/gamemode/player_extension.lua][gamemodes/fretta/gamemode/cl_deathnotice.lua]
TEST [gamemodes/fretta/gamemode/round_controller.lua][gamemodes/fretta/gamemode/cl_deathnotice.lua]
TEST [gamemodes/fretta/gamemode/shared.lua][gamemodes/fretta/gamemode/cl_deathnotice.lua]
TEST [gamemodes/fretta/gamemode/skin.lua][gamemodes/fretta/gamemode/cl_deathnotice.lua]
TEST [gamemodes/fretta/gamemode/sv_spectator.lua][gamemodes/fretta/gamemode/cl_deathnotice.lua]
TEST [gamemodes/fretta/gamemode/utility.lua][gamemodes/fretta/gamemode/cl_deathnotice.lua]

[ERROR] gamemodes/fretta/gamemode/vgui/vgui_gamenotice.lua:37: attempt to index local 'txt' (a nil value)
  1. AddEntityText - gamemodes/fretta/gamemode/vgui/vgui_gamenotice.lua:37
   2. AddText - gamemodes/fretta/gamemode/vgui/vgui_gamenotice.lua:54
    3. AddDeathNotice - gamemodes/fretta/gamemode/cl_deathnotice.lua:96
     4. func - gamemodes/base/gamemode/cl_deathnotice.lua:64
      5. unknown - lua/includes/modules/net.lua:30



Thanks in advance

Edit: Also, after this happens, it says "suicide killed " in the top left corner, which does not go away.

Show us the god dam code.

Right.

cl_deathnotice



/*
	Start of the death message stuff.
*/

include( 'vgui/vgui_gamenotice.lua' )

local function CreateDeathNotify()

	local x, y = ScrW(), ScrH()

	g_DeathNotify = vgui.Create( "DNotify" )
	
	g_DeathNotify:SetPos( 0, 25 )
	g_DeathNotify:SetSize( x - ( 25 ), y )
	g_DeathNotify:SetAlignment( 9 )
	g_DeathNotify:SetSkin( GAMEMODE.HudSkin )
	g_DeathNotify:SetLife( 4 )
	g_DeathNotify:ParentToHUD()

end

hook.Add( "InitPostEntity", "CreateDeathNotify", CreateDeathNotify )

local function RecvPlayerKilledByPlayer( message )

	local victim 	= message:ReadEntity();
	local inflictor	= message:ReadString();
	local attacker 	= message:ReadEntity();
	
	GAMEMODE:AddDeathNotice( victim, inflictor, attacker )	
end
	
usermessage.Hook( "PlayerKilledByPlayer", RecvPlayerKilledByPlayer )


local function RecvPlayerKilledSelf( message )

	local victim 	= message:ReadEntity();			
	GAMEMODE:AddPlayerAction( victim, GAMEMODE.SuicideString );

end
	
usermessage.Hook( "PlayerKilledSelf", RecvPlayerKilledSelf )


local function RecvPlayerKilled( message )

	local victim 	= message:ReadEntity();
	local inflictor	= message:ReadString();
	local attacker 	= "#" .. message:ReadString();
			
	GAMEMODE:AddDeathNotice( victim, inflictor, attacker )

end
	
usermessage.Hook( "PlayerKilled", RecvPlayerKilled )

local function RecvPlayerKilledNPC( message )

	local victim 	= "#" .. message:ReadString();
	local inflictor	= message:ReadString();
	local attacker 	= message:ReadEntity();
			
	GAMEMODE:AddDeathNotice( victim, inflictor, attacker )

end
	
usermessage.Hook( "PlayerKilledNPC", RecvPlayerKilledNPC )


local function RecvNPCKilledNPC( message )

	local victim 	= "#" .. message:ReadString();
	local inflictor	= message:ReadString();
	local attacker 	= "#" .. message:ReadString();
		
	GAMEMODE:AddDeathNotice( victim, inflictor, attacker )

end

usermessage.Hook( "NPCKilledNPC", RecvNPCKilledNPC )


/*---------------------------------------------------------
   Name: gamemode:AddDeathNotice( Victim, Weapon, Attacker )
   Desc: Adds an death notice entry
---------------------------------------------------------*/
function GM:AddDeathNotice( victim, inflictor, attacker )

	if ( !IsValid( g_DeathNotify ) ) then return end

	local pnl = vgui.Create( "GameNotice", g_DeathNotify )
	
	pnl:AddText( attacker )
	pnl:AddIcon( inflictor )
	pnl:AddText( victim )
	
	g_DeathNotify:AddItem( pnl )

end

function GM:AddPlayerAction( ... )
	
	if ( !IsValid( g_DeathNotify ) ) then return end

	local pnl = vgui.Create( "GameNotice", g_DeathNotify )

	for k, v in ipairs({...}) do
		pnl:AddText( v )
	end
	
	// The rest of the arguments should be re-thought.
	// Just create the notify and add them instead of trying to fit everything into this function!???
	
	g_DeathNotify:AddItem( pnl )
	
end


vgui_gamenotice



-- client cvars to control deathmsgs
local hud_deathnotice_time = CreateClientConVar( "hud_deathnotice_time", "6", true, false )
local hud_deathnotice_limit = CreateClientConVar( "hud_deathnotice_limit", "5", true, false )

/*
	This is the player death panel. This should be parented to a DeathMessage_Panel. The DeathMessage_Panel that
	it's parented to controls aspects such as the position on screen. All this panel's job is to print the
	specific death it's been given and fade out before its RetireTime.
*/

local PANEL = {}

Derma_Hook( PANEL, 	"Paint", 				"Paint", 	"GameNotice" )
Derma_Hook( PANEL, 	"ApplySchemeSettings", 	"Scheme", 	"GameNotice" )
Derma_Hook( PANEL, 	"PerformLayout", 		"Layout", 	"GameNotice" )

function PANEL:Init()
	self.m_bHighlight = false
	self.Padding = 8
	self.Spacing = 8
	self.Items = {}
end

function PANEL:AddEntityText( txt )

	if ( type( txt ) == "string" ) then return false end
	
	if ( type( txt ) == "Player" ) then 
	
		self:AddText( txt:Nick(), GAMEMODE:GetTeamColor( txt ) )
		if ( txt == LocalPlayer() ) then self.m_bHighlight = true end
		
		return true
		
	end

	if( txt:IsValid() ) then
		self:AddText( txt:GetClass(), GAMEMODE.DeathNoticeDefaultColor )	
	else
		self:AddText( tostring( txt ) )	
	end

end

function PANEL:AddItem( item )

	table.insert( self.Items, item )
	self:InvalidateLayout( true )
	
end

function PANEL:AddText( txt, color )

	if ( self:AddEntityText( txt ) ) then return end
	
	local txt = tostring( txt )
	
	local lbl = vgui.Create( "DLabel", self )
	
	Derma_Hook( lbl, 	"ApplySchemeSettings", 	"Scheme", 	"GameNoticeLabel" )
	lbl:ApplySchemeSettings()
	lbl:SetText( txt )
	
	if( string.Left( txt , 1 ) == "#" && !color ) then color = GAMEMODE.DeathNoticeDefaultColor end // localised ent death
	if( GAMEMODE.DeathNoticeTextColor && !color ) then color = GAMEMODE.DeathNoticeTextColor end // something else
	if ( !color ) then color = color_white end
	
	lbl:SetTextColor( color )
	
	self:AddItem( lbl )

end

function PANEL:AddIcon( txt )

	if ( killicon.Exists( txt ) ) then

		local icon = vgui.Create( "DKillIcon", self )
			icon:SetName( txt )
			icon:SizeToContents()

		self:AddItem( icon )
	
	else
	
		self:AddText( "killed" )
	
	end
	
end

function PANEL:PerformLayout()

	local x = self.Padding
	local height = self.Padding * 0.5
	
	for k, v in pairs( self.Items ) do
	
		v:SetPos( x, self.Padding * 0.5 )
		v:SizeToContents()
		
		x = x + v:GetWide() + self.Spacing
		height = math.max( height, v:GetTall() + self.Padding )
	
	end
	
	self:SetSize( x + self.Padding, height )
	
end

derma.DefineControl( "GameNotice", "", PANEL, "DPanel" )


I don’t think the copy of Fretta that comes with PH is actively being updated - Some stuff from the newest Gmod update messed up the Fretta death/suicide strings a while back.

Scrap this copy, download Nox’s Fretta13 and then just rename it to fretta or change the fretta bits to fretta13 in PH.
http://www.noxiousnet.com/forums/index.php?topic=16615.0

That seems to have fixed it! Thank you very much!