Disabling default scoreboard (not a gamemode)

Well I am trying to make a scoreboard but everytime I press TAB the default Sandbox tab comes up aswell as mine behind it? Is there anyway I can disable it inside of my scoreboard lua file?


local ScoreboardDerma = nil

function ScoreboardShow()
   if !IsValid(ScoreboardDerma) then
      ScoreboardDerma = vgui.Create( "DFrame" )
	  ScoreboardDerma:SetSize( 750, 500 )
	  ScoreboardDerma:SetPos(ScrW()/ 2 - 325, ScrH()/ 2 - 250)
	  ScoreboardDerma:SetTitle( "Scoreboard" )
	  ScoreboardDerma:SetDraggable(false)
	  ScoreboardDerma:ShowCloseButton(false)
	  ScoreboardDerma.Paint = function()
	    draw.RoundedBox(5, 0, 0, ScoreboardDerma:GetWide(), ScoreboardDerma:GetTall(), Color(60, 60, 60, 255))
	  end
   end
   
   if IsValid(ScoreboardDerma) then
      ScoreboardDerma:Show()
	  ScoreboardDerma:MakePopup()
	  ScoreboardDerma:SetKeyboardInputEnabled(false)
   end
   
end
hook.Add( "ScoreboardShow", "ScoreboardShow", ScoreboardShow )

function ScoreboardHide()
   if IsValid(ScoreboardDerma) then
      ScoreboardDerma:Hide()
   end
end
hook.Add( "ScoreboardHide", "ScoreboardHide", ScoreboardHide )

I am not making a gamemode, and I have clearly got that there… if you bothered to read. I am trying to make a custom file (already done), that just disables the DEFAULT TAB MENU

:snip: I was wrong, returning false in a hook cancels the scoreboard.

Using GM: in a file that aint a Gamemode it don’t work.
Maybe I could return ScoreboardShow like if not ScoreboardDerma then return false?

[editline]30th July 2016[/editline]

Nope, I have to phyisically edit Prophunt ? but how do people on scriptfodder make custom Scoreboards/Tab menus and remove the old one?

[editline]30th July 2016[/editline]

Sandbox not prophunt

[editline]30th July 2016[/editline]

Oh and I know with HUD’s you can test for CHealth & that, and disable it. But how can you do that for scoreboards?

:snip: You’re right, it doesn’t. This does though:



hook.Add( "ScoreboardShow", "Idk", function()
    return false
end )


[editline]30th July 2016[/editline]

Also, please make your functions local

Sweet it works, thanks MPan1