title: Attempt to call a table value error on Roblox studio
body: <p>I am having a problem with a game I am coding on Roblox. Essentially, the game breaks when the character respawns.</p>
  
  <p>I have a server-side script in which certain platforms are ''scored'', then saved into a table.
  In that server-side script I have a function that when a player scores fires an event to all clients updating that table. ON my local script I save the table that I receive to a local table against which the local script checks whether the platform is available. It all works until respawn. On respawn, the local table is empty. I am trying to fix this via a remote function that checks on respawn if the table in the server-side scrip has something in it.</p>
  
  <p>The problem I have is that now, when the game starts, and no one has scored yet, the local script is checking if the table has something and as the table is empty, I get an error. My line:</p>
  
  <pre><code>local platsScored = FetchTableOfPlatsScored:InvokeServer()
  </code></pre>
  
  <p>error:</p>
  
  <pre><code>attempt to call a table value
  </code></pre>
  
  <p>Instead, I tried to do something like this:</p>
  
  <pre><code>if FetchTableOfPlatsScored:InvokeServer() then 
      platsScored = FetchTableOfPlatsScored:InvokeServer() 
  else platsScored = {} 
  end
  </code></pre>
  
  <p>Which, in my logic, is checking if there is something in the table and if there is it loads it into the local table and if not sets the table. This is giving me the same error. So my question is, what do I have to wrap my invoke server remote function in, not to get an error if the table is empty.</p>
  
  <p>Another solution I have tried is on my server side script to modify the function:</p>
  
  <pre><code>local function passTable()
      return platsScored
  
  end
  
  FetchTableOfPlatsScored.OnServerInvoke = passTable()
  </code></pre>
  
  <p>to something along the lines of </p>
  
  <pre><code>local function passTable()
      if platsScored ~= nil then
         return platsScored
      else
      ** what do I write here that won't break the code*
  end
  </code></pre>