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

DataStore: Argument 1 missing or nil. How to fix?

Hey!

My script is trying to create three variables that aren't yet defined stored in DataStore, and then with a server script I am trying to change the variables to the client's player name.

(the variables im trying to change)

However when I run this:

datastore

It returns an error:

Argument 1 missing or nil

1 comment

0

Not sure why this is happening but just to let you know the first image shows datastore key

1 answer

Due to my vague knowledge on what you are trying to achieve, I will run through a problem I'm seeing with your scripting.

Use of if , else, and elseif

You seem to be putting a spaces where it isn't necessary! Lets take steps back to learn how these work.

if (bool1) then
    print('step one')
elseif (bool2) then
    print('step two')
else
    print('final resort')
end
bool1 bool2 Output
true step one
false true step two
false false final resort
If bool1 of these is true, it'll run whatever is in that if statement. However, if it isn't I'll skip down to elseif and check another if statement. If the if statement and all the elseif statements fail, it will finally go to the else statement.

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