I do not know what caused this, but recently the dummy studio clients you can use such as Player1 and Player2, their data has been saving onto the acutal game. This is an issue, because the OrderedDataStores can’t find a player with the userId -1, and crash the script so that any legit player that has a value less than those dummy players does not exist.
local RS = game:GetService("RunService")
local DSS = game:GetService("DataStoreService")
local datastore = nil
if RS:IsStudio() then
datastore = DSS:GetOrderedDataStore("studiokey")
datastore = DSS:GetOrderedDataStore("gamekey")
That’s smart. To fix the current issue i just automatically set all dummy key values to -10, and I already have a system of keytags if i need to reset the data during testing, so your idea should be easy to implement, thank you!