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

Datastoring question [True or false]??

Asked by 9 years ago

I didnt really understand the wiki..

I just would need a true or false statment, and maybe a example if you want to.. c:

--I use datastore for number value's and it work's fine but is Datastore able to save a string value?

1, Is it possible to save a string with datastore?

1 answer

Log in to vote
0
Answered by
BlackJPI 2658 Snack Break Moderation Voter Community Moderator
9 years ago

Yes, you can save strings using data stores. You can not save instances and mixed list tables.

Example:

local mixedListTable = {
    [1] = 3 -- The key is a number
    [2] = "A string"
    ["A string"] = 5 -- The key is a string
    [4] = "Another string"
}

-- Because it has a key that is a string and another that is a number, you will get the error 'keys must be strings'
0
So will {Player_ID=839839,Chat='wdidjiw'} work? MessorAdmin 598 — 9y
0
Yes, because it is not a mixed-list table but rather a map-style table BlackJPI 2658 — 9y
0
Ty! :D MessorAdmin 598 — 9y
0
Just make sure you set the key properly { [Player_ID] = 839839, [Chat] = 'wdidjiw'} BlackJPI 2658 — 9y
Ad

Answer this question