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

DataStoreError, makes no sense?

Asked by 5 years ago
Edited 5 years ago

I have no clue why this is erroring if anyone could help me, would be much appreciated.

-- This is a OrderedDataStore 

function copInfo:createProfile(p, username, password)
    local newTbl = {username, password}
    newTbl = http:JSONEncode(newTbl)
    pcLoginDs:SetAsync(p.UserId, newTbl) -- LINE 178
end

copInfo:createProfile(plrs:WaitForChild("papasherms"), "test1", "test2") -- LINE 181

ERROR: 103: string is not allowed in DataStore Stack Begin Script 'ServerScriptService.mainScript', Line 178 - method createProfile Script 'ServerScriptService.mainScript', Line 181 Stack End

2 answers

Log in to vote
0
Answered by 5 years ago

https://wiki.roblox.com/index.php?title=API:Class/OrderedDataStore

"OrderedDataStore is a type of DataStore where the value must be an integer (positive number)"

You can only store ints in ordered data stores, for anything else you should use a global data store.

Ad
Log in to vote
0
Answered by
Rare_tendo 3000 Moderation Voter Community Moderator
5 years ago

OrderedDataStores can't store strings, use a DataStore instead.

Replace the pcLoginDs variable with:

local pcLoginDs = game:GetService('DataStoreService'):GetDataStore('the name you put for your datastore')

Answer this question