It only gives me 0,0,0 even when the value is changed so it doesnt save the value for some reason idk
for i,bruh in pairs(vehicles1) do
local ve = Instance.new("IntValue")
ve.Name = bruh.Name
ve.Parent = player.CivCars
local ColorValue = Instance.new("Color3Value")
ColorValue.Name = "ColorSave"
ColorValue.Value = rep.CivCars1[ve.Name].ColorSave.Value
ColorValue.Parent = ve
local data
local success,errormessage = pcall(function()
data = DataStore2:GetAsync(player.UserId)
end)
if success then
print(data)
if data ~= nil then
local LoadedColor3 = data
local Color1 = Color3.new(LoadedColor3[1], LoadedColor3[2], LoadedColor3[3])
ColorValue.Value = Color1
end
end
game.Players.PlayerRemoving:Connect(function(player)
local Color = ColorValue.Value
local SaveableColor3 = {Color.r, Color.g, Color.b}
local sucess,errormessage = pcall(function()
DataStore2:SetAsync(player.UserId,SaveableColor3)
end)
if success then
print("saved")
else
print("anerror")
warn(errormessage)
end
end)