Why i keep getting this error when i join server its giving me the same error OnPlayerKill function when i headshot
status[ killer.ID ].Headshots++;
(https://i.postimg.cc/zvjtq8fP/xd.png)
status[ killer.ID ] is null. Initialize it when joining inside the onPlayerJoin() function.
Quote from: Athanatos on Jul 15, 2022, 01:02 AMstatus[ killer.ID ] is null. Initialize it when joining inside the onPlayerJoin() function.
Can you give any example how ?
Because
status[ killer.ID ].Kills++; work perfectly
but when i put
status[ killer.ID ].Headshots++; Its give error same with the Joins++;
Initialize the "Headshots" field in the player stats's class constructor to 0.
Thanks Athanatos problem solved :)