Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Creates Folder But Not BoolValues?

Asked by 5 years ago
Edited 5 years ago

i want it to create folder and inside folder bool values but its creates only folder how to fix it?

local DataStore = game:GetService("DataStoreService")
local ds = DataStore:GetDataStore("MYNAMISJEF")

game.Players.PlayerAdded:Connect(function(player)
    local key = "Player"..player.UserId
    local c = Instance.new("Folder")
    c.Name = "CostumesBools"
    c.Parent = player

    local Costume = Instance.new("BoolValue")
    Costume.Name = "Costume"
    Costume.Value = false
    Costume.Value = ds:GetAsync(key)[1] or false
    Costume.Parent = c

    local Costume2 = Instance.new("BoolValue")
    Costume2.Name = "Costume2"
    Costume2.Value = false
    Costume2.Value = ds:GetAsync(key)[2] or false
    Costume2.Parent = c
end)

game.Players.PlayerRemoving:Connect(function(player)
    local costumes = player.CostumesBools
    local key = "Player"..player.UserId
    ds:SetAsync(
        key, 
        {
            costumes.Costume.Value,
            costumes.Costume2.Value
        }
    )
end)
0
try to make the folder on ServerStorage and name it like player's name it should work Axdrei 107 — 5y

Answer this question