heres what i want:
local Players = game.Players local Template = Instance.new 'BoolValue' Template.Name = 'leaderstats' Instance.new('IntValue', Template).Name = "Kills" Instance.new('IntValue', Template).Name = "Deaths" Instance.new('IntValue', Template).Name = "Bux" Players.PlayerAdded:Connect(function(Player) wait(1) local Stats = Template:Clone() Stats.Parent = Player local Deaths = Stats.Deaths Player.CharacterAdded:connect(function(Character) Deaths.Value = Deaths.Value + 1 local Humanoid = Character:FindFirstChild "Humanoid" if Humanoid then 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 "Kills" then -- but also "Bux" here, i can only grab "Kills" but not both. local Kills = Killer.leaderstats.Kills local Bux = Killer.leaderstats.Bux Kills.Value = Kills.Value + 1 Bux.Value = Bux.Value + math.Random(15,25) end return end end end) end end) end)
what i try to do is increase 2 int values from the leaderboard when a kill is made but is there another instance than findfirstshild so that i can increase both instead of 1?
the r in math.random isn't capitalized