I recommend serializing colors to Hex code before trying to save them, so that it’s stored in ascii characters. You can convert with something like this Color3 ToHex
-- Assuming CBooth is a Color3Value
local boothColor = player.SystemData.CBooth.Value
local boothColorHex = boothColor:ToHex()
myDataStore:UpdateAsync(someKey, function(oldvalue)
local newValue = oldValue or {}
-- Use boothColorHex as the color value saved here
newValue.BoothColor = boothColorHex
end)
-- later, when loading:
local data = myDataStore:GetAsync(someKey)
local boothColorHex = data.BoothColor
local boothColor = Color3.fromHex(boothColorHex)
player.SystemData.CBooth.Value = boothColor
As @JAcoboiskaka1121 stated you should use :ToHex() when converting them. You should also consider using Profile store which is a great datastore module, your script is fine but you should wrap GetAsync / SetAsync on pcall for catching errors. You should also keep everything inside one key because this can overload datastores, your script with hex:
local Text = "Write Your Text"
local DataText = "TextData"
local DataFonts = "FontsData"
local DataBooth = "BoothData"
local DataStore = game:GetService("DataStoreService")
local TextDS = DataStore:GetDataStore("TextDataSaved2")
local FontsDS = DataStore:GetDataStore("FontsDataSaved")
local BoothDS = DataStore:GetDataStore("BoothDataSaved2")
local HATCHEDDATA = DataStore:GetDataStore("HatchedData26")
local BoothColor = DataStore:GetDataStore("SureVBooth")
local newplayer = true
--Don't worry about the rest of the code, except for line 25.
game.Players.PlayerAdded:connect(function(player)
local Data = Instance.new("Folder",player)
Data.Name = "SystemData"
local CuzTextNew = Instance.new("StringValue",Data)
CuzTextNew.Name = DataText
CuzTextNew.Value = TextDS:GetAsync(player.UserId) or Text
local CuzText = Instance.new("IntValue",Data)
CuzText.Name = DataFonts
local CuzColor = script.CBooth:Clone()
CuzColor.Parent = Data
local defaultBoothColor = Color3.new(0,0,0)
local success, boothColor = pcall(function()
return BoothColor:GetAsync(player.UserId)
end)
if success and BoothColor then
defaultBoothColor = Color3.fromHex(boothColor)
end
CuzColor.Value = defaultBoothColor
CuzText.Value = FontsDS:GetAsync(player.UserId) or 12187376174
local CuzTextT = Instance.new("StringValue",Data)
CuzTextT.Name = DataBooth
CuzTextT.Value = BoothDS:GetAsync(player.UserId) or "Default"
local hatchedbool = Instance.new("BoolValue",Data)
hatchedbool.Name = "Hatched"
hatchedbool.Value = HATCHEDDATA:GetAsync(player.UserId) or newplayer
------
end)
game.Players.PlayerRemoving:connect(function(player)
HATCHEDDATA:SetAsync(player.UserId, player.SystemData.Hatched.Value)
TextDS:SetAsync(player.UserId, player.SystemData.TextData.Value)
FontsDS:SetAsync(player.UserId, player.SystemData.FontsData.Value)
BoothDS:SetAsync(player.UserId, player.SystemData.BoothData.Value)
BoothColor:SetAsync(player.UserId, player.SystemData.CBooth.Value:ToHex())
end)