Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Roblox DataStore - Requested was Throttled?

Asked by 4 years ago
local datastore = game:GetService("DataStoreService")
local ds2 = datastore:GetDataStore("savecolor1111")
local SaveEvent = game.ReplicatedStorage.ColorEvent1

game.Players.PlayerAdded:connect(function(plr)
local Water = plr:WaitForChild("SaveColor1"):WaitForChild("Value")



 Water.Value = ds2:GetAsync(plr.UserId) or 0
 ds2:SetAsync(plr.UserId, Water.Value)



end)

SaveEvent.OnServerEvent:Connect(function(oldplr)
local Water = oldplr:WaitForChild("SaveColor1"):WaitForChild("Value")
    ds2:SetAsync(oldplr.UserId, Water.Value)
    print("saved")
    end)
game.Players.PlayerRemoving:Connect(function(plr)
    local Water = plr:WaitForChild("SaveColor1"):WaitForChild("Value")
    ds2:SetAsync(plr.UserId, Water.Value)
    print("saved")

end)

what im doing wrong?

0
Never save data based on when the client wants to save. That'll lead to terrible issues down the road. User#29813 0 — 4y

Answer this question