When the players die the values are not being updated. I have tried running this in player starter scripts, playergui, and have even cloned it directly into the player. It is not working.
Any help is appreciated.
First attempt using local script.
local player = game.Players.LocalPlayer
local char = player.Character
repeat wait() until char
char:FindFirstChild("Humanoid").Died:connect(function()
if player.TeamColor == "Bright red" then
game:GetService("Workspace").LeaderBoard.Red.Value = game:GetService("Workspace").LeaderBoard.Red.Value + 1
elseif player.TeamColor == "Bright blue" then
game:GetService("Workspace").LeaderBoard.Blue.Value = game:GetService("Workspace").LeaderBoard.Blue.Value + 1
end
end)
Second attempt using remote events.
Local script:
local player = game.Players.LocalPlayer
local char = player.Character
repeat wait() until char
char:FindFirstChild("Humanoid").Died:connect(function()
game.ReplicatedStorage.Died:FireServer()
end)
Server script:
function died (player)
print(player.TeamColor)
if player.TeamColor == "Bright red" then
workspace.LeaderBoard.Red.Value = workspace.LeaderBoard.Red.Value + 1
print("Red Died")
elseif player.TeamColor == "Bright blue" then
workspace.LeaderBoard.Blue.Value = workspace.LeaderBoard.Blue.Value + 1
print("Blue Died")
else print("Error Error Error")
end
end
game.ReplicatedStorage.Died.OnServerEvent:connect(died)
I am able to print TeamColor but not check the value. All attempts are printing the Error.
I have tried checking it by TeamColor.Name, and TeamColor.Color. Same results.

3 comments
I do not believe you can change leaderboard values with a LocalScript in a FilteringEnabled environment. Though personally I have not gone and tested this.
I was testing this script, and the weird thing is that the 'Died' event is not firing at all.
Filtering enabled is not on. I have been trying to figure this out all day. I changed the script to use remote events. The Died event is now firing but it is still not updating the values. I will post the new scripts.