This is a leveling script, it increases a player's level when they exceed the needed 'XP'. I keep getting the same error, even though I'm not exceeding the throttle limit. Here's the script:
local ods = game:GetService("DataStoreService"):GetOrderedDataStore("Level")
local ods2 = game:GetService("DataStoreService"):GetOrderedDataStore("XP")
while true do
local plays = game.Players:GetChildren()
wait(#plays)
local plrs = game.Players:GetChildren()
for _, i in pairs(plrs) do
if i:FindFirstChild("CanSave") then
if i.CanSave.Value == true then
local val1 = i.Level.Value
local val2 = i.XP.Value
local num = nil
if val1 == 1 then
num = 300
else
num = math.floor(300*(1.5)^val1)
end
if val2 >= num then
ods:IncrementAsync(i.UserId,1) ---This is the line that errors, claiming 'provisionedThroughputExceeded'
i.Level.Value = i.Level.Value + 1
local rem = i.Level.Value
local gui = game.Lighting.NewLev:Clone()
gui.Parent = i.PlayerGui
if math.fmod(rem,2) == 0 then
local gui = game.Lighting.New:Clone()
gui.Parent = i.PlayerGui
end
end
end
end
end
end
