I’m making a remake of Classic: Rocket Arena, and I’m almost done after the kills/deaths leaderboard update, but there’s 1 problem.
This problem is that when you fall on a killbrick, you die, obviously. But the killbrick’s kill doesn’t actually count as a death.
My kill/death leaderboard is scaled for rocket launcher kills, so I tried adding a function that checks when you die, and then award you a death, but that doesn’t work, and only makes the death count stop as a whole.
Here’s my code as a reference:
local function addBoard(player)
local board = Instance.new("Folder", player)
board.Name = "leaderstats"
local kills = Instance.new("IntValue", board)
kills.Name = "KOs"
local deaths = Instance.new("IntValue", board)
deaths.Name = "WOs"
end
game.Players.PlayerAdded:Connect(function(player)
addBoard(player)
player.CharacterAdded:Connect(function(char)
local hum = char:WaitForChild("Humanoid")
hum.Died:Connect(function(plr)
plr.leaderstats.WOs.Value += 1
local tag = hum:FindFirstChild("creator")
if tag and tag.Value then
local ePlayer = tag.Value
ePlayer.leaderstats.KOs.Value += 1
end
end)
end)
end)
Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.