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

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

Asked by
Uglypoe 557 Donator Moderation Voter
8 years ago

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
1
What did it return ? Spectrobz 140 — 8y
0
ummmm you forgot a closing parenthsis near :GetAsync("user" .. ) and another value to follow after .. koolkid8099 705 — 8y
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! Uglypoe 557 — 8y

1 answer

Log in to vote
0
Answered by
Uglypoe 557 Donator Moderation Voter
8 years ago

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

Ad

Answer this question