Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Why does this not return nil when the Wiki says it should?

As you can see below, I have a variable called "olddata". It uses GetAsync on a key dependent on player userids. According to the Wiki, if the key doesn't exist, it should return nil. I tested this out on a brand-new account, and alas, it didn't return nil. Does anybody have a solution to this?

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

3 comments

1

What did it return ?

0

ummmm you forgot a closing parenthsis near :GetAsync("user" .. ) and another value to follow after ..

0

@koolkid You have to read the SourceCode for it. Also, I found the issue. It was in a different one of my scripts. Thanks for the help anyways!

1 answer

Bug was in a different script, not these 4 lines of code. It has been resolved.

This discussion is preserved as it was. New answers, comments, and votes are closed.