I have a datastore that stores hair and race values but for some reason it only saves the hair value
local DataStore = game:GetService("DataStoreService")
local ds = DataStore:GetDataStore("RaceData")
local HairDs = DataStore:GetDataStore("HairDataStore")
game.Players.PlayerAdded:connect(function(player)
local leader = Instance.new("Folder",player)
leader.Name = "Data"
local Cash = Instance.new("StringValue",leader)
Cash.Name = "Race"
Cash.Value = ds:GetAsync(player.UserId) or "None"
ds:SetAsync(player.UserId, Cash.Value)
Cash.Changed:connect(function()
ds:SetAsync(player.UserId, Cash.Value)
end)
local HairData = Instance.new("NumberValue",leader)
HairData.Name = "HairVal"
HairData.Value = HairDs:GetAsync(player.UserId) or -1
HairDs:SetAsync(player.UserId, HairData.Value)
HairData.Changed:Connect(function()
HairDs:SetAsync(player.UserId, HairData.Value)
end)
end)
game.Players.PlayerRemoving:connect(function(player)
ds:SetAsync(player.UserId, player.Data.Race.Value)
HairDs:SetAsync(player.UserId, player.Data.HairVal.Value)
end)
in this clip I set my race to otsu but it wont save