Still have questions? Join our Discord server and get real time help.
0

# DataStore script is "Missing an Argument" when I'm not. Any help?

Hey, so I have this data store script/leaderstats script. It keeps spitting out an error which is "Missing Argument 1 on Line 2" so... yeah. THIS IS A REGULAR SCRIPT BTW.

local DataStoreService = game:GetService('DataStoreService')
local DataCredits = DataStoreService:GetDataStore(credits)

local playerCredits = Instance.new('IntValue')
playerCredits.Name = 'Credits'
playerCredits.Value = DataCredits:GetAsync(player.UserId)
end)

game.Players.PlayerRemoving:connect(function(player)
end)


This is also being consistent with Line 3.

0
My line 21 isn't on 2 lines, it's just no space. AwesomeUniverseYT 37 — 8mo
0
have you defined credits/premium? or at least putting quotation marks around them. abnotaddable 861 — 8mo
0
You haven't showed what you assigned 'credits' nor 'premium' to. GetDataStore's argument requires a string, so you'll have to put quotation marks around credits and premium Doobb_yyus 2236 — 8mo

2
As stated in the comments, GetDataStore's argument requires a string.
local DataCredits = DataStoreService:GetDataStore("credits")