KeyNotFoundException with my pluginSolved
if (!Cachedplayerstats.ContainsKey(player.userID)) 
{
    PVEStatsData.TryLoad(player.userID);
    PlayerMsg(player, string.Format(msg("StatsMessage", player.userID), new object[] { Cachedplayerstats[player.userID].scientistkills, Cachedplayerstats[player.userID].heavyKills, Cachedplayerstats[player.userID].murdererkills, Cachedplayerstats[player.userID].scarecrowkills }));
}
5e13a8d5b2bc5.jpg Wulf
if (!Cachedplayerstats.ContainsKey(player.userID)) 
{
    PVEStatsData.TryLoad(player.userID);
    PlayerMsg(player, string.Format(msg("StatsMessage", player.userID), new object[] { Cachedplayerstats[player.userID].scientistkills, Cachedplayerstats[player.userID].heavyKills, Cachedplayerstats[player.userID].murdererkills, Cachedplayerstats[player.userID].scarecrowkills }));
}
private void cmdShowStatistics(BasePlayer player, string command, string[] args)
        {

            if (!Cachedplayerstats.ContainsKey(player.userID))
            {
                PVEStatsData.TryLoad(player.userID);
                PlayerMsg(player, string.Format(msg("StatsMessage", player.userID), new object[] { Cachedplayerstats[player.userID].scientistkills, Cachedplayerstats[player.userID].heavyKills, Cachedplayerstats[player.userID].murdererkills, Cachedplayerstats[player.userID].scarecrowkills }));
            }
        }

i did exactly what u put and am still getting these errors: 

Failed to call hook 'OnEntityDeath' on plugin 'NPCKillCounter v1.0.0' (NullReferenceException: Object reference not set to an instance of an object)
at Oxide.Plugins.NPCKillCounter.GetPlayerKills (BasePlayer player) [0x0003a] in <4c0c738667bd43e0aec892752b097939>:0
at Oxide.Plugins.NPCKillCounter.OnEntityDeath (BaseCombatEntity entity, HitInfo info) [0x001e6] in <4c0c738667bd43e0aec892752b097939>:0
at Oxide.Plugins.NPCKillCounter.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x00177] in <4c0c738667bd43e0aec892752b097939>:0
at Oxide.Plugins.CSharpPlugin.InvokeMethod (Oxide.Core.Plugins.HookMethod method, System.Object[] args) [0x00079] in <d09a1f46ca2f4432811bcfe45ad13c7b>:0
at Oxide.Core.Plugins.CSPlugin.OnCallHook (System.String name, System.Object[] args) [0x000d8] in <cf88a28c7fb44d36890d85a78331cc9d>:0
at Oxide.Core.Plugins.Plugin.CallHook (System.String hook, System.Object[] args) [0x00060] in <cf88a28c7fb44d36890d85a78331cc9d>:0

Nevermind I fixed it.


Merged post

Thanks for the help Wulf :)
Locked automatically