Gmod quadro aberto quando o jogador morre



function ADS(victim, attacker, DFrame)
if victim != attacker and victim:IsPlayer() then
	local Frame = vgui.Create( "DFrame" )
	Frame:SetPos( 5, 5 )
	Frame:SetSize( 300, 150 )
	Frame:SetTitle( "Advisement" )
	Frame:SetVisible( true )
	Frame:SetDraggable( false )	
	Frame:ShowCloseButton( false )
	Frame:MakePopup()
 local html = vgui.Create( "HTML", frame )
 html:Dock( FILL )
 html:OpenURL( "wiki.garrysmod.com" )
 timer.Simple( 10, function() 
 Frame:Close()
		end )
	end
elseif victim == attacker and victim:IsPlayer() then
		local Frame = vgui.Create( "DFrame" )
	Frame:SetPos( 5, 5 )
	Frame:SetSize( 300, 150 )
	Frame:SetTitle( "Advisement" )
	Frame:SetVisible( true )
	Frame:SetDraggable( false )	
	Frame:ShowCloseButton( false )
	Frame:MakePopup()
 local html = vgui.Create( "HTML", frame )
 html:Dock( FILL )
 html:OpenURL( "wiki.garrysmod.com" )
 timer.Simple( 10, function() 
 Frame:Close()
		end )
end
hook.Add( "PlayerDeath", "DFrame", ADS )


I’m trying to make this code. When the player dies, open a frame that is an html page (if the player killed by another player or even killed)
but i don’t have idea for why don’t work. help

Look at the pages you linked. PlayerDeath is a serverside hook. You should either network the client’s death to them or use

gameevent.Listen and make an entity_killed hook.

I added some indentation and comments to show some of the other problems with your code
[lua]function ADS(victim, attacker, DFrame) --the inflictor is the second argument of playerdeath, attacker is the third

if victim != attacker and victim:IsPlayer() then
	
	local Frame = vgui.Create( "DFrame" )
	Frame:SetPos( 5, 5 )
	Frame:SetSize( 300, 150 )
	Frame:SetTitle( "Advisement" )
	Frame:SetVisible( true )
	Frame:SetDraggable( false )	
	Frame:ShowCloseButton( false )
	Frame:MakePopup()
	
	local html = vgui.Create( "HTML", frame ) --frame doesn't exist, lua is case sensitive
	html:Dock( FILL )
	html:OpenURL( "wiki.garrysmod.com" )
	
	timer.Simple( 10, function() 
		
		Frame:Close()
		
	end )
	
end

--elseif for an if statement that already ended
--unnecessary, just remove the "victim != attacker" part in the first if statement
elseif victim == attacker and victim:IsPlayer() then
	
	local Frame = vgui.Create( "DFrame" )
	Frame:SetPos( 5, 5 )
	Frame:SetSize( 300, 150 )
	Frame:SetTitle( "Advisement" )
	Frame:SetVisible( true )
	Frame:SetDraggable( false )	
	Frame:ShowCloseButton( false )
	Frame:MakePopup()
	
	local html = vgui.Create( "HTML", frame )
	html:Dock( FILL )
	html:OpenURL( "wiki.garrysmod.com" )
	
	timer.Simple( 10, function() 
		
		Frame:Close()
		
	end )
	
end

–the function has no end

hook.Add( “PlayerDeath”, “DFrame”, ADS ) --as txike already pointed out, playerdeath is serverside[/lua]

Also, if you’re trying to play an advertisement whenever a player dies, please don’t.