-
What do you want to achieve?
I want to save a string and bool value. I have saved number values in the past and they worked just fine. -
What is the issue?
The string and bool values do not save. I use a folder to save all my values. All the number values save perfectly fine but when I try using string and bool values in Datastore2 they just do not save. -
What solutions have you tried so far?
I looked up string values not saving with datastore2, but none of the forum posts fixed my issue. I may be using datastore2 wrong but I have gotten no errors or anything.
-- String Value
local Gender = Datastore("Gender", Player)
Gender:Set("None")
local GenderValue = Instance.new("StringValue")
GenderValue.Value = Gender:Get("None")
GenderValue.Name = "Gender"
GenderValue.Parent = PlayerData
GenderValue.Changed:Connect(function()
Gender:Set(GenderValue.Value)
end)
-- Bool Value
local FirstJoin = Datastore("FirstJoin", Player)
FirstJoin:Set(false)
local FirstJoinValue = Instance.new("BoolValue")
FirstJoinValue.Value = FirstJoin:Get(false)
FirstJoinValue.Name = "FirstJoin"
FirstJoinValue.Parent = PlayerData
FirstJoinValue.Changed:Connect(function()
FirstJoin:Set(FirstJoinValue.Value)
end)