I want to go into the files and remove the red screen, but I can’t find it anywhere. I would assume it would be in gamemode/base somewhere, but I have no idea. Anybody know where it might be?
You can disable it by using something like the following:
hook.Add( "HUDShouldDraw", "RemoveRedScreenOnDeath", function( name ) if ( name == "CHudDamageIndicator" ) then return false end end )
This may end up removing a few other random damage indicators when you take damage but don’t actually die. Not too sure, since the brief red flash still occurs when taking normal damage.
Either way, this does disable the red screen on death.
Due to the fact I am learning lua, I was hoping exactly this would work. Though, when added to both client and server lua files, it didn’t do anything. Am I uploading it wrong?
This should only run on the client, so you won’t need to put it in a server file.
May I know how you’ve added it clientside? There could be a few reasons why it isn’t running, such as not AddCSLuaFile()'ing it from the server and include()'ing it on the client.
A really simple way to check would be to create a file in some addon like /addons/myaddon/lua/autorun/redscreen.lua (or any autorun file you may have):
if ( CLIENT ) then MsgC( Color( 0, 255, 0 ), "Loading redscreen.lua " ) hook.Add( "HUDShouldDraw", "DisableRedScreenOnDeath", function( name ) if ( name == "CHudDamageIndicator" ) then MsgC( Color( 0, 255, 0 ), "Blocking red screen! " ) return false end end ) end
Since files in lua/autorun are executed by both the server and client automatically, you won’t have to AddCSLuaFile()/include() anything.
Every time you die (**not **via ‘kill’ in console), you should see “Blocking red screen!” pretty much spammed in your console while you’re dead.
It works great, thank you so much for dealing with my ignorance!