I want to give the player 10 coins per kill, and add it to the coins leaderboard, as leaderstats. Also, I want to know how many kills the player has, and how to input that information inside the leaderstats.
Insert an ObjectValue into the killable entities. This instance will serve as a "last attacker" record as each time a player attacks a killable entity, they will write their Player instance to ObjectValue.Value
. When the entity dies, it will read from the "last attacker" record and perform the necessary actions.
(Ensure attacks cannot follow through if the entity is already dead)