I’m making a replica of Classic: Rocket Arena, and I’m trying to make them as similar as possible. I’m adding a kills/deaths leaderboard to almost completely finish this replica, but there’s 2 problems.
Those 2 are…
- Rocket Kills don’t count as a kill, as it’s the only way to kill someone in this game.
- When you touch the lava on the edges, doing so counts as 2 deaths.
So far, I’ve surfed the internet to look for any possible solutions, but none worked. And when I went to look on the DevForum, nothing matched the problem I had.
Here’s all my code:
local plrs = game.Players
local temp = Instance.new 'BoolValue'
temp.Name = 'leaderstats'
Instance.new('IntValue', temp).Name = "KOs"
Instance.new('IntValue', temp).Name = "WOs"
plrs.PlayerAdded:Connect(function(plr)
wait(1)
local stats = temp:Clone()
stats.Parent = plr
local deaths = stats.WOs
plr.CharacterAdded:Connect(function(char)
deaths.Value = deaths.Value + 1
local humanoid = char:FindFirstChild "Humanoid"
if humanoid then
humanoid.Died:Connect(function()
deaths.Value = deaths.Value + 1
for i, child in pairs(humanoid:GetChildren()) do
if child:IsA('ObjectValue') and child.Value and child.Value:IsA('Player') then
local ko = child.Value
if ko:FindFirstChild 'leaderstats' and ko.leaderstats:FindFirstChild "KOs" then
local kills = ko.leaderstats.KOs
kills.Value = kills.Value + 1
end
return
end
end
end)
end
end)
end)