local dataStore = game:GetService("DataStoreService"):GetDataStore("randommeusumtime")
starterRolls = 0
game.Players.PlayerAdded:Connect(function(plr)
local leaderstats = Instance.new("Folder")
leaderstats.Name = "leaderstats"
leaderstats.Parent = plr
local points = Instance.new("IntValue")
points.Name = "Time Spent"
points.Value = dataStore:GetAsync(plr.UserId)
points.Parent = leaderstats
while true do
wait(1)
points.Value = points.Value + 1
end
end)
game:BindToClose(function(plr)
dataStore:SetAsync(plr.UserId, plr.leaderstats["Time Spent"].Value)
end)
Save script wont work. Very bogus since 4 others have fixed it, but save scripts hate me.

1 comment
edited my answer. try now.