Let's have a closer look at the first error:
[ERROR] gamemodes/base/gamemode/player.lua:205: Tried to use a NULL entity!Right... A bit of code from the base gamemode is trying to use a non-existent entity. Let's check out
player.lua:205:
function GM:PlayerDeath( ply, inflictor, attacker )
-- ...
net.WriteString( inflictor:GetClass() ) -- line 205
-- ...
end
The PlayerDeath hook function is failing because one of its arguments,
inflictor, is
NULL. The function didn't expect that... it really needs this information! Therefore, we must always tell Garry's Mod who/what inflicted damage on a player.
The part of your script that's responsible for dealing damage:
local dmginfo = DamageInfo()
dmginfo:SetDamage( damage )
dmginfo:SetDamageType( DMG_DISSOLVE )
Must also include who caused the attack:
Giving information about the attacker should fix the error. The PlayerDeath function is smart enough to figure out that the
attacker is also the
inflictor.