-
What do you want to achieve? Keep it simple and clear!
im trying to make a game and im trying to make character customization to save -
What is the issue?
-
What solutions have you tried so far? -
i tried looking at some topics but i need help understanding most of the stuff needed to save color3 values to my data store
heres my code
local players = game:GetService("Players")
local datastore = game:GetService("DataStoreService")
local datastore1 = datastore:GetDataStore("leaderstat2")
local datastore2 = datastore:GetDataStore("customize")
players.PlayerAdded:connect(function(player)
local folder = Instance.new("Folder")
folder.Name = "leaderstats2"
folder.Parent = player
local tutorial = Instance.new("BoolValue")
tutorial.Name = "Tut"
tutorial.Parent = player.leaderstats2
tutorial.Value = datastore1:GetAsync(player.UserId) or false
datastore1:SetAsync(player.UserId, tutorial.Value)
local shirt = Instance.new("Color3Value")
shirt.Name = "Shirt"
shirt.Parent = player.leaderstats2
shirt.Value = datastore2:GetAsync(player.UserId) or Color3.fromRGB(86, 36, 36)
datastore2:SetAsync(player.UserId, shirt.Value)
tutorial.Changed:connect(function()
datastore1:SetAsync(player.UserId, tutorial.Value)
end)
shirt.Changed:connect(function()
datastore2:SetAsync(player.UserId, shirt.Value)
end)
end)