diff --git a/gamemode/engine/core/server/sv_player_damage.lua b/gamemode/engine/core/server/sv_player_damage.lua index 25bf8dc..8c073a8 100644 --- a/gamemode/engine/core/server/sv_player_damage.lua +++ b/gamemode/engine/core/server/sv_player_damage.lua @@ -63,7 +63,9 @@ hook.Add( "EntityTakeDamage", "Quantum_PlayerDamage_SoundEffect", function( pl, end) timer.Simple( 60, function() - timer.Remove( "Quantum_PlayerHurtSounds_" .. tostring( pl:SteamID64() ) ) -- remove the timer for the player + if( IsValid( pl ) ) then + timer.Remove( "Quantum_PlayerHurtSounds_" .. tostring( pl:SteamID64() ) ) -- remove the timer for the player + end end) end diff --git a/gamemode/settings/sh_effects.lua b/gamemode/settings/sh_effects.lua index 34705c0..1046f71 100644 --- a/gamemode/settings/sh_effects.lua +++ b/gamemode/settings/sh_effects.lua @@ -29,12 +29,14 @@ Quantum.Effect.Create( "equip_potatoe", { pl.runtimeEffect_timerActive_equip_potatoe = false end, runtimefunc = function( pl ) - if( !pl.runtimeEffect_timerActive_equip_potatoe ) then - pl.runtimeEffect_timerActive_equip_potatoe = true - timer.Simple( 1, function() - pl:SetHealth( math.Clamp( pl:Health() + 5, 1, pl:GetMaxHealth() ) ) - pl.runtimeEffect_timerActive_equip_potatoe = false - end) + if( IsValid( pl ) ) then + if( !pl.runtimeEffect_timerActive_equip_potatoe ) then + pl.runtimeEffect_timerActive_equip_potatoe = true + timer.Simple( 1, function() + pl:SetHealth( math.Clamp( pl:Health() + 5, 1, pl:GetMaxHealth() ) ) + pl.runtimeEffect_timerActive_equip_potatoe = false + end) + end end end, stopfunc = function( pl )