local dataStore = game:GetService("DataStoreService"):GetDataStore("randommeusumtime")
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"
points.Value = dataStore:GetAsync(plr.UserId)
points.Parent = leaderstats
while true do
wait(1)
points.Value = points.Value + 1
end
end)
game:BindToClose(function()
for _,plr in pairs(game.Players:GetPlayers()) do
dataStore:SetAsync(plr.UserId, plr.leaderstats.Time.Value)
end
end)
API Services are also activated, dont know why this isn't saving, as there is no errors.
