hello, i am trying to make it so when a player is killed like in this code:
the player who killed the other player gets a + in the leaderstats
how can i do this?
i need to locate the leaderstats and do a +1
In the damage function of your weapon check if the current humanoid health - damage is less than or equal to 0 if it is add a kill yo their leaderstats by doing leaderstats.Kills.Value += 1 which is the same as doing leaderstats.Kills.Value = leaderstats.Kills.Value + 1
i already know how to do the + stats but… the only thing i need to know is how to locate the leaderstats so i can actually do the + is its like Game.Players.LocalPlayer or smth?
i just dont get it wich is stupid cuz i can do many other things
you can get the character from the weapon’s script and at the damaging function you can check if the target’s health is 0 then you can + 1 in leaderstats
u can get the player from character by using game.Players:GetPlayerFromCharacter() and locate leaderstats from there