I don't see any errors when ever I play my game through the site but it still doesn't work
Here's my script :
local DataStore = Game:GetService("DataStoreService"):GetDataStore("Level")
local Requests = 0
local Max = 60
function Good()
return Requests <= Max
end
function UpdateMax()
Max = 60 + 10 * #Game.Players:GetPlayers()
end
Game.Players.PlayerAdded:connect(function(Player)
local Stat = Player:WaitForChild("stats"):WaitForChild("Level")
Stat.Value = DataStore:GetAsync(Player.userId)
Stat.Changed:connect(function()
if Good() then
DataStore:SetAsync(Player.userId,Stat.Value)
Requests = Requests + 1
end
end)
end)
Game.Players.PlayerRemoving:connect(function()
UpdateMax()
end)
Spawn(function()
while wait(60) do
Requests = 0
end
end)

2 comments
You won't see anything happen if Player:WaitForChild("stats"):WaitForChild("Level") never completes.
ah