How to save bool values and strings in DataStore2?

How do I save bool values and string values in DataStore2?

E.g.:

local hasPurchasedUpgrade1Store = DataStore2(player, "hasPurchasedUpgrade1")
local houseNameStore = DataStore2(player, "houseName")

...

local hasUpgrade1 = hasPurchasedUpgrade1Store:Get(false)

...

local houseName = houseNameStore:Get("Default House Name")

...

hasPurchasedUpgrade1Store:Set(true)

....

houseNameStore:Set(textBox.Text)

Give us more info about your use case if you want more specific help :+1:

2 Likes

OHHH!! So instead of Increment its set! Thanks! :smiley:

1 Like

Yep! Increment is only really useful for numbers. You can’t increase a bool or a string, it only really makes sense for numbers, and only when you don’t know what you want to set it to, you only know you want to increase it by some amount. E.g. instead of having to do store:Set(store:Get(defaultValue) + 10) you just do store:Increment(10) (if I remember the syntax right).

I already know how to use datastore2. I just didn’t know about set!

1 Like

How do I do strings? Is it PointStore:Set(“Text”) . Never mind found it out.

1 Like