Made this huge script but it doesnt save or load the values
local DataStore = game:GetService("DataStoreService"):GetDataStore("Look")
game.Players.PlayerAdded:connect(function(player)
--Crear a leaderboard
local look = Instance.new("Model",player)
look.Name = "Clothes"
local Hair = Instance.new("IntValue",player.Clothes)
Hair.Name = "Hair"
local Wearing = Instance.new("IntValue",player.Clothes)
Wearing.Name = "Shirt"
local Face = Instance.new("IntValue",player.Clothes)
Face.Name = "Face"
local CheckPoint = Instance.new("IntValue",player.Clothes)
CheckPoint.Name = "CheckPoint"
local SkinColor = Instance.new("IntValue",player.Clothes)
SkinColor.Name = "SkinColor"
local Sound = Instance.new("IntValue",player.Clothes)
Sound.Name = "Sound"
-- Buscar os dados do player
local key = "player-"..player.userId
local savedV = DataStore:GetAsync(key)
if savedV then
-- {This table assigns all aspects from your look}
Hair.Value = savedV[1]
Wearing.Value = savedV[2]
Face.Value = savedV[3]
CheckPoint.Value = savedV[4]
SkinColor.Value = savedV[5]
Sound.Value = savedV[6]
else
local valuesToSave = {Hair.Value, Wearing.Value,Face.Value,CheckPoint.Value,SkinColor.Value,Sound.Value}
DataStore:SetAsync(key, valuesToSave)
end
end)
game.Players.PlayerRemoving:connect(function(player)
local key = "player-"..player.userId
local valuesToSave = {player.Clothes.Hair.Value, player.Clothes.Wearing.Value, player.Clothes.Face.Value, player.Clothes.CheckPoint.Value, player.Clothes.SkinColor.Value, player.Clothes.Sound.Value}
DataStore:SetAsync(key, valuesToSave)
end)

3 comments
connect is depricated use Connect -->> just saying
I recommend saving a JSON table using JSONEncode, and then use JSONDecode when you want to view it. It saves space, so you can store more in a string instead of a table.
Also, I've used :connect and it still works.