Deathscreen Error

Hello,

Ive got my own deathscreen, but it gives an error that i can’t solve or maybe im just to blind to see it.
When a player dies a screens pops up and they have to click a button in order to respawn.

But when the player clicks the button they don’t respawn and it gives the following error:



[ERROR] lua/autorun/client/cl_deathscreen.lua:193: Calling net.Start with unpooled message name! [http://goo.gl/qcx0y]
  1. Start - [C]:-1
   2. DoClick - lua/autorun/client/cl_deathscreen.lua:193
    3. unknown - lua/vgui/dlabel.lua:232



Here is my button and deathscreen loader:


	local ExitButton = vgui.Create( "DButton", DeathScreenFrame )
	ExitButton:SetFont("Lobby")
	ExitButton:SetText( "Exit to game" )
	ExitButton:SetTextColor( Color(255,255,255,250) )
	ExitButton:SetSize(200, 50)
	ExitButton:SetPos( ScrW() / 1 - 165 - ExitButton:GetWide(), ScrH() - 100 - ExitButton:GetTall() )
	ExitButton.Paint = function(self, w, h)
		draw.RoundedBox( 0, 0, 0, w, h, Color( 50, 50, 50, 150 ) )
	end
	ExitButton.DoClick = function(self)
		DeathScreenFrame:Close()
		net.Start("PUBG_RequestExitGame")
		net.SendToServer()
	end


util.AddNetworkString( "PUBG_DeathScreen" ) 

local GM_TABLE
if(GM) then GM_TABLE = GM else GM_TABLE = GAMEMODE end

function GM_TABLE:PlayerDeath( ply, inflictor, attacker )
	net.Start("PUBG_DeathScreen") 
		net.WriteBool(true)
	net.Send(ply) 
	if(ply == attacker) then
		ply:AddFrags(1)
	end 
end 

function GM_TABLE:PlayerSpawn( ply ) 
	net.Start("PUBG_DeathScreen")
	ply:Spawn()
		net.WriteBool(false)
	net.Send(ply)
end

function GM_TABLE:PlayerDeathThink( ply ) 
	return;
end

Thanks in advance.

You need to do


util.AddNetworkString()

for the “PUBG_RequestExitGame”

Or your can just follow that URL from the error

Ahh, i was blind after all.
It now gives no errors, but the player doesn’t respawn?

Because you’re overriding the gamemode PlayerDeath hook instead of using hook.Add.

I see it! Thank you!