local DataStore = game:GetService("DataStoreService"):GetDataStore("Points")
local label = player.PlayerGui.TimeLeft.Frame.TimeLeftLabel
local ready = player.PlayerGui.TimeLeft.Frame.Ready.ReadyToVisit


game.Players.PlayerAdded:connect(function(player)
	local user = "user_" .. player.userId
	--we want to give 1 point to users each time they visit
	DataStore:UpdateAsync(user, function(oldValue)
		local points = oldValue or 0 --oldValue might be nil
if ready.Value == true then
		points = points + 1
		return points
		end
	end)
end)

 
game.Players.PlayerAdded:connect(function(player)
	local key = "user_" .. player.userId
	--we want to give 50 points to users each time they visit
	DataStore:UpdateAsync(key, function(oldValue)
		local newValue = oldValue or 300 --oldValue might be nil
		
while true do
if ready.Value == false then
repeat
print("repeat")
newValue = newValue - 1
print(newValue)
label.Text = newValue
wait(1) --60
until newValue == 0
end
wait(5)	 --60
end
		
		
		return newValue
	end)
end)

Technically this is the guidelines. Could anyone point me in the right direction?

2 comments

0

Output please?

0

The output is not needed. What IS needed is what the script is supposed to do.