DataStore Saving With Color on Value Not work

Just use DataStore:SetSync() but instead of the value, convert it to a hex with my method.

Not that hard to do.

i so think hard it
ertfgreghrtghbytg

BoothColor:SetAsync(player.UserId, Color3.new(player.SystemData.CBooth.Value):ToHex())

should be something like that.

Next GetSync?
wofergmjrfigjkntfgbhtf

Uhhh, yeah, use DataStore:GetSync() to get the data ig, this is just basic data store knowledge.

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)
1 Like

i try it now!
eewrfregwasdweger

Not working
here video
Sorry Its max MB

Could you please provide a screenshot of the output?

image

Hmm, my bad. You should change it to this instead:

BoothColor:SetAsync(player.UserId, player.SystemData.CBooth.Value:ToHex())
1 Like

Not work
Not showing Output
dd

Interesting. Could you print out the BoothColor after :GetAsync()?

1 Like
local defaultBoothColor 
	
	
	defaultBoothColor = Color3.fromHex(BoothColor:GetAsync(player.UserId)) or Color3.new(0,0,0)

YES WORKEDDDD IT
Thank you :slight_smile:
AADSJDMSJ

1 Like

This one worked Btw thank you It
i tired fixing like day 3

Dude u broke my game



image

What did you change, this is likely caused by one of your scripts since the script I provided works fine. Your error states that there is no hex value, could you provide me the newest script?

1 Like

Dont worry i used ChatGpts is worked it

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.