I've done this and not sure how to add a lvl to a player after 30 seconds. every 30 seconds.
local datastore = game:GetService("DataStoreService"):GetDataStore("")
game.Players.PlayerAdded:connect(function(player)
local leaderstats = Instance.new("IntValue")
leaderstats.Name = "leaderstats"
leaderstats.Parent = player
local points = Instance.new("IntValue")
points.Name = "Level"
points.Parent = leaderstats
local key = "user-" .. player.userId
local storeditems = datastore:GetAsync(key)
if storeditems then
points.Value = storeditems[1]
else
local items = {points.Value}
datastore:SetAsync(key, items)
end
end)
game.Players.PlayerRemoving:connect(function(player)
local items = {player.leaderstats.Level.Value}
local key = "user-" .. player.userId
datastore:SetAsync(key, items)
end)

1 comment
while 1 == 1 do game.player.leaderstats.Level.Value = game.player.leaderstats.Level.Value + 1 wait(30)