I tested this on a brand-new alternate account just to see what would happen. It's supposed to only run the code if that old entry has a value to it. However, it runs for new players even though it shouldn't. Is there a way to fix this? I'll elaborate more if needed.

local olddata = game:GetService("DataStoreService"):GetDataStore("Pokemon"):GetAsync("user_"..newPlayer.userId.."_Pokemon")
if (olddata ~= nil and olddata ~= "1") then
convertspecials(olddata,newPlayer)
end

1 comment

0

The wiki says that if the key doesn't exist, it returns nil. However, even when I tested it on a brand-new account, it still fired the "convertspecials" function. Why??