Okay so a while ago I made this script that counts the player's playtime, but it's very bad for server performance, any ideas on how to make it more efficient?
game.Players.PlayerAdded:Connect(function(plr)
task.wait(5)
local val = plr:WaitForChild("leaderstats"):WaitForChild("Playtime")
while task.wait(1) do val.Value += 1 end
end)
Would it be more efficient to do something like:
while task.wait(1) do
for i,v in game.Players:GetChildren() do
v:WaitForChild("leaderstats"):WaitForChild("Playtime").Value += 1
end
end