game.Players.PlayerAdded:Connect(function(Player)
local leaderstats = Instance.new('IntValue')
leaderstats.Name = 'leaderstats'
leaderstats.Parent = Player
local Rank = Instance.new('StringValue')
Rank.Name = 'Rank'
Rank.Value = 'F'
Rank.Parent = leaderstats
local Points = Instance.new('NumberValue')
Points.Value = 0
Points.Name = 'Points'
Points.Parent = Player
Points.Changed:Connect(function()
if Points.Value >= 4 then
Rank.Value = 'E'
end
end)
Player.CharacterAdded:connect(function(Character)
local Humanoid = Character:WaitForChild"Humanoid"
Humanoid.Died:connect(function()
for i, Child in pairs(Humanoid:GetChildren()) do
if Child:IsA('ObjectValue') and Child.Value and Child.Value:IsA('Player') then
local Killer = Child.Value
if Killer:FindFirstChild('leaderstats') and Killer.leaderstats:FindFirstChild('Points') then
local Points = Killer.leaderstats.Points
Points.Value = Points.Value + 1
end
end
end
end)
end)
end)
COMMUNITY QUESTION
How come when I get a kill my points value does not go up?
0 answers
No public answers were preserved for this question.
This discussion is preserved as it was. New answers, comments, and votes are closed.
