How to make a skincolor datastore?

Hey so i know the title may be weird but uhh, im trying to make a datastore in which when you click a button it changes your skincolor and it will save your decision without showing the same gui again after rejoining, i tried to find a tutorial on youtube but nothing helped.

  • Make a skin color selector

    • When a color is selected, save to the datastore. Use the player’s UserId as the key, and the value is the color3. If color3’s can’t be saved in datastores (not sure) then I suggest just mapping the RGB values to a string, and save that instead.
  • When a player joins, check if they have a saved skincolor. If not, open the color selector.

local DataStoreService = game:GetService("DataStoreService")

local colorStore = DataStoreService:GetDataStore("SkinColors")

local success, color = pcall(function()
	return experienceStore:GetAsync(player.UserId)
end)

if success then
	print(color)
else
-- open the color selector
end

-- Call this function when the player chooses a color
function colorSelectorColorPicked(player, color)
	local success, errorMessage = pcall(function()
		colorStore SetAsync(player.UserId, color)
	end)
	
	if not success then
		print(errorMessage)
	end
end
1 Like

are the colors the player can choose finite (out of a set list) or can a player pick any color?

1 Like

You could datastore a string that contains the skin color and then load the color in that string when the player joins

1 Like