Hello! i am trying to make a system where you can buy/equip skins based on if you have them unlocked, however, for some reason, the “Skins” datastore DOES NOT EXIST. i’ve tried looking at it with a datastore editor, its not there. Ingame it doesnt save anything. I’ve tried prints, i’ve tried manually adding the datastore, nothing. Please help!!
local DataStoreService = game:GetService("DataStoreService")
local Datastore = DataStoreService:GetDataStore("Skins")
print(Datastore)
function YEAHCOMEGETSOME(player)
local Folder = Instance.new("Folder", player)
Folder.Name = "Skins"
print(Datastore:GetAsync(player))
if Datastore:GetAsync(player) then
for i,v in pairs(Datastore:GetAsync(player)) do
print(v)
local WORKDAMNYOU = game.ReplicatedStorage.Skins:FindFirstChild(v)
WORKDAMNYOU.Parent = Folder
print(WORKDAMNYOU)
end
end
if Datastore:GetAsync(player) then
print("Player has skins!!!")
else
local StartingCharacterValue = Instance.new("StringValue")
StartingCharacterValue.Name = "Default"
StartingCharacterValue.Parent = Folder
end
end
function YEAHCOMELOSESOME(player)
local SaveThese = {}
for i,v in pairs(player.Skins:GetChildren()) do
print(v)
table.insert(SaveThese, {v.Name})
end
print(SaveThese)
Datastore:SetAsync(player, SaveThese)
end
game.Players.PlayerAdded:Connect(YEAHCOMEGETSOME)
game.Players.PlayerRemoving:Connect(YEAHCOMELOSESOME)