local DataStoreService = game:GetService("DataStoreService")
local deaths = DataStoreService:GetDataStore("PlayerDeaths")
local function onPlayerJoin(player)
local leaderstats = Instance.new("Folder")
leaderstats.Name = "leaderstats"
leaderstats.Parent = player
local deaths = Instance.new("IntValue")
deaths.Name = "Accidents"
deaths.Parent = leaderstats
player.CharacterAdded:Connect(function(char)
-- detect humanoid died.
char.Humanoid.Died:Connect(function()
print("e")
local success, newDeath = pcall(function()
print("ee")
return deaths:IncrementAsync(player.UserId, 1)
end)
print(newDeath)
if success then
deaths.Value = newDeath-- add 1 value to values
print(newDeath)
end
end)
end)
end
game.Players.PlayerAdded:Connect(onPlayerJoin)
e and ee print the first newDeath results in "IncrementAsync is not a valid member of IntValue"

1 comment
thanks i done goofed