Hi ! i need help with my leaderboard, is work but when i leave the server the Time Played return to 0.. i want save my progression with datastore but i don't know how it's work ? Thanks for help :)
function onPlayerEntered(Player)
local stats = Instance.new("IntValue")
stats.Name = "leaderstats"
local secs = Instance.new("IntValue")
secs.Name = "Time Played"
secs.Value = 0
secs.Parent = stats
stats.Parent = Player
while true do
secs.Value = secs.Value + 1
wait(1)
end
end
game.Players.ChildAdded:connect(onPlayerEntered)

2 comments
watch peaspod's tutorial
PeasPod's videos are old and will contain deprecated code. At least today they are.