Hi! I am making a pet shop system and I am using DataStore2 and altered my original design instead of adding bools for every pet I am using a list. However… table.Insert() doesn’t work. Or maybe it does and I am just a noob scripter. 
The Code:
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local DataStore2 = require(1936396537)
local remoteEvent = ReplicatedStorage.petShopEvent
local petInfo = require(ReplicatedStorage.PetInfo)
remoteEvent.OnServerEvent:Connect(function(player, node)
local coinsStore = DataStore2("coins", player)
local ownedPets = DataStore2("pets", player)
local petTable = ownedPets:GetTable({})
local price = petInfo["pet"..node].price
local selectedPet = "pet"..node
if petTable.selectedPet == nil then -- Not owned yet.
if coinsStore:Get(0) > price then
-- The player has enough money
print("The player has enough money")
petTable.Insert(selectedPet)
ownedPets:Set(petTable)
else
warn("Not enough money")
end
else
warn("Already owned")
end
end)
The error: ![]()