I’m glad you said this. Upon a deeper look, commenting out everything in the table that’s being returned allows the InvokeServer to return the table.
Something inside of this PlayerData module is causing this error to occur.
Note: This module script is on the server and is what’s being returned when I return DataHandler[DataType].
local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local ServerStorage = game:GetService("ServerStorage")
local ServerScriptService = game:GetService("ServerScriptService")
local ProfileService = require(ServerScriptService.ProfileService)
local HouseHandler = require(ServerScriptService.Main.HouseHandler)
local PlayerData = {
Profiles = {},
GameProfileStore = ProfileService.GetProfileStore(
"PlayerData",
{
Location = "Residential",
Level = 1,
Gold = 0,
Quests = {},
Settings = {},
HouseInfo = {
HouseName = nil,
HouseColor = {R = 13, G = 33, B = 77},
AssignedHouse = nil,
EquippedHouse = "House1"
},
Inventory = {
Houses = {"House1"},
Furniture = {},
Pets = {},
Food = {},
Vehicles = {},
Misc = {}
},
DailyReward = {
CurrentDay = 1,
Claimed = false
}
}
),
FetchData = function(self, Player)
return self.Profiles[Player].Data
end,
LoadData = function(self, Player)
local profile = self.GameProfileStore:LoadProfileAsync(
"Player_" .. Player.UserId,
"ForceLoad"
)
if profile ~= nil then
profile:Reconcile()
profile:ListenToRelease(function()
self.Profiles[Player] = nil
Player:Kick()
end)
if Player:IsDescendantOf(Players) == true then
self.Profiles[Player] = profile
else
profile:Release()
end
else
Player:Kick()
end
end,
SaveData = function(self, Player)
local profile = self.Profiles[Player]
if profile ~= nil then
profile:Release()
end
end,
PlaceOverhead = function(self, Character)
local Player = Players[Character.Name]
local Overhead = ReplicatedStorage.Interface.Overhead:Clone()
local PlayerHead = Character:WaitForChild("Head")
Overhead.Parent = PlayerHead
Overhead.Adornee = PlayerHead
Overhead.Main.LevelFrame.Level.Text = self.Profiles[Player].Data.Level
Overhead.Main.PlayerName.Text = Player.Name
end,
AssignHouse = function(self, Player, Houses, InteriorHouses)
local AssignedHouseId = HouseHandler:RemoveFirstVacantHouse()
self.Profiles[Player].Data.HouseInfo.AssignedHouse = AssignedHouseId
local AssignedHouse = workspace.ResidentialArea.Houses["HouseSpacer" .. AssignedHouseId]
local AssignedInterior = workspace.ResidentialArea.InteriorHouses["InteriorHouseSpacer" .. AssignedHouseId]
local EquippedInterior = ServerStorage.HouseInteriors[self.Profiles[Player].Data.EquippedHouse .. "Interior"]:Clone()
Player.RespawnLocation = AssignedHouse.SpawnLocation
AssignedHouse.Owner.Value = Player.Name
AssignedHouse.Billboard.Owner.Text = Player.Name .. "'s Home"
EquippedInterior.Parent = AssignedInterior
EquippedInterior:SetPrimaryPartCFrame(AssignedInterior.HouseMatch.CFrame)
HouseHandler:SetupResidentialTeleport(Player, EquippedInterior, AssignedHouseId)
end,
RemoveOwner = function(self, Player, Houses, InteriorHouses)
local AssignedHouseId = self.Profiles[Player].Data.HouseInfo.AssignedHouse
local AssignedHouse = workspace.ResidentialArea.Houses["HouseSpacer" .. AssignedHouseId]
local AssignedInterior = workspace.ResidentialArea.InteriorHouses["InteriorHouseSpacer" .. AssignedHouseId]
AssignedHouse.Owner.Value = ""
AssignedHouse.Billboard.Owner.Text = "Vacant"
HouseHandler:InsertVacantHouse(AssignedHouseId)
for _, Model in pairs(AssignedInterior:GetChildren()) do
if Model:IsA("Model") then
Model:Destroy()
end
end
self.Profiles[Player].Data.HouseInfo.AssignedHouse = nil
end,
}
return PlayerData