A server script with a simple save on leave function no longer works when you’re testing in studio.
local DSS = game:GetService("DataStoreService")
local PLR = game:GetService("Players")
local save = DSS:GetDataStore("Save")
PLR.PlayerRemoving:Connect(function()
print("saving")
save:SetAsync(123, "test")
print("it saved")
end)
Do you have it set to yield within BindToClose?
ie
game:BindToClose(function()
task.wait(2)
end)
Because the server will “immediately” close in studio if it doesn’t have to wait for anything in the bindToClose function, so any Async functions won’t run unless we yield in BindToClose.
I cannot replicate your issue after yielding in BindToClose.
I’m experiencing the same issue. Everything worked fine about 16 hours ago, but since then it’s been hit‑or‑miss—it errors when running/fails to run about half of the time.
I haven’t touched any settings, and rolling back to a version from three days ago didn’t fix it either…