Pretty simple! Just make a server script, and connect it to a PlayerAdded Event.
Then, make a folder inside the PlayerObject called leaderstats, then make a intvalue called Time Left. Then just wait a second and loop through all players and decrease their score by one.
game:GetService("Players").PlayerAdded:Connect(function(player)
local stats = Instance.new("Folder")
stats.Name = "leaderstats"
local timeLeft = Instance.new("IntValue")
timeLeft.Name = "Time Left"
timeLeft.Parent = stats
timeLeft.Parent = player
end)
while wait(1) do
for i, v in pairs(game.Players:GetChildren()) do
v.leaderstats.timeLeft.Value -= 1
end
end
That is because the person that gave you the code made a slight mistake.
game:GetService("Players").PlayerAdded:Connect(function(player)
local stats = Instance.new("Folder")
stats.Name = "leaderstats"
local timeLeft = Instance.new("IntValue")
timeLeft.Name = "Time Left"
timeLeft.Parent = stats
stats.Parent = player
end)
while wait(1) do
for i, v in pairs(game.Players:GetChildren()) do
v.leaderstats.timeLeft.Value -= 1
end
end
All they did was accidentally set the parent of the IntValue twice instead of setting the parent of the folder to the character.
If you want this to work properly, you will have to add more yourself thinking about what the starting time should be, and what the conditions of the countdown would be. MichaelEpicA has only given you an example.