I made this leaderboard that sets it up, also rewarding 3 tokens and 1 kill. When I kill another player, that doesn't happen. Help?
game.Players.PlayerAdded:connect(function(player) local leaderstats = Instance.new("Model") leaderstats.Name = "leaderstats" leaderstats.Parent = player local tokens = Instance.new("IntValue") tokens.Name = "Tokens" tokens.Value = 0 tokens.Parent = leaderstats local kills = Instance.new("IntValue") kills.Name = "Kills" kills.Value = 0 kills.Parent = leaderstats player.CharacterAdded:connect(function(chr) local chr = player.Character chr.Humanoid.Died:connect(function(chr) local chr = player.Character local killer = chr.Humanoid:findFirstChild("creator") if killer then killer.leaderstats.Kills.Value = killer.Value.Kills.Value + 1 killer.leaderstats.Tokens.Value = killer.leaderstats.Tokens.Value + 3 end end) end) end)
the killer's player instance would be killer.Value so:
local plrwhokilled = killer.Value plrwhokilled.leaderstats.Kills.Value = plrwhokilled.leaderstats.Kills.Value + 1 --and so on