I am currently making an obby. I added a death counter script, but I also had a levels script to show what level you are on. The levels script did not function properly when I added in the death counter script. Here is the script for the death counter:
ocal plrs = game.Players
plrs.PlayerAdded:Connect(function(plr)
local stats = Instance.new("Folder")
stats.Name = "leaderstats"
stats.Parent = plr
local wipeouts = Instance.new("IntValue")
wipeouts.Name = "Wipeouts"
wipeouts.Value = 0
wipeouts.Parent = stats
plr.CharacterAdded:Connect(function(char)
local humanoid = char:FindFirstChild("Humanoid")
humanoid.Died:Connect(function()
wipeouts.Value = wipeouts.Value + 1
end)
end)
end)
