I’m having some trouble for with my data store, basically the issue is saying that “v” doesn’t have the property “name”
local codes = require(script.Codes)
local event = game.ReplicatedStorage.CodeEvent
local sound = game.ReplicatedStorage.Sound
local cd = game:GetService("DataStoreService"):GetDataStore("CodeData")
game.Players.PlayerAdded:Connect(function(plr)
local cf = Instance.new("Folder", plr)
cf.Name = "CodeFolder"
local data = cd:GetAsync(plr.UserId .. "_Codes")
if data then
for i,v in pairs(data) do
local dv = Instance.new("BoolValue", cf)
dv.Name = v.Name
end
end
end)
game.Players.PlayerRemoving:Connect(function(player)
local data = {}
for i,v in pairs(player:WaitForChild("CodeFolder"):GetChildren()) do
table.insert(data, v.Name)
end
cd:SetAsync(player.UserId .. "_Codes", data)
end)