i do not get any errors but "red" does not get created, unless i move it above "WhichSelected" but then "WhichSelected" does not get created
local players = game:GetService("Players")
local datastore = game:GetService("DataStoreService")
local ds1 = datastore:GetDataStore("Gs165g61g6sg16G6")
local ds2 = datastore:GetDataStore("Gsga1hs61sd5j1sj6s1")
players.PlayerAdded:connect(function(player)
local folder = Instance.new("Folder")
folder.Name = "Colors"
folder.Parent = player
local WhichEquipped = Instance.new("StringValue")
WhichEquipped.Name = "WhichIsEquipped"
WhichEquipped.Parent = player
WhichEquipped.Value = ds1:GetAsync(player.UserId) or "Red"
ds1:SetAsync(player.UserId, WhichEquipped.Value)
local red = Instance.new("BoolValue")
red.Name = "RedUnlocked"
red.Parent = player.Colors
red.Value = ds2:GetAsync(player.UserId) or false
ds2:SetAsync(player.UserId, red.Value)
WhichEquipped.Changed:connect(function()
ds1:SetAsync(player.UserId, WhichEquipped.Value)
end)
red.Changed:connect(function()
ds2:SetAsync(player.UserId, red.Value)
end)
end)
i think something is wrong with these lines
red.Value = ds2:GetAsync(player.UserId) or false
ds2:SetAsync(player.UserId, red.Value)

4 comments
Are there any errors printed to the output? And when you mean "red" does not get created, do you mean the datastore entry or the BoolValue?
there are no errors, and i mean the bool value
set red's parent to folder. So line 19 should say red.Parent = folder
You have to make another int value but you have to make the leaderstats the values parent like: