Table Issue (15 chars)

Please excuse my horrid knowledge of tables.

local result, policyInfo = pcall(function()
	  PolicyService:GetPolicyInfoForPlayerAsync(player)
  end)
  
  if not result then
    
    error("PolicyService error: " .. policyInfo)
    
 
  elseif not table.find(result["AllowedExternalLinkReferences"], "Discord") then

small code snippet, yes player is defined. I am assuming this error has to do with the string.find:
ServerScriptService.UserInfo:18: attempt to index boolean with 'AllowedExternalLinkReferences
What’s the fix? Please, if you have time, explain it to me because I need to expand my knowledge on defining tables and all that.

result is a boolean. But you are trying to index it at

Revised code:

local ok, data = pcall(PolicyService.GetPolicyInfoForPlayerAsync, PolicyService, player)

if ok then
    if not table.find(data.AllowedExternalLinkReferences, "Discord") then
        -- something
    end
else
    warn(data)
end

Where you have “result” listed will be returned as a boolean success indicator due to how pcall returns results.

You need to actually return the PolicyService:GetPolicyInfoForPlayerAsync() function itself.

local result, policyInfo = pcall(function()
    return PolicyService:GetPolicyInfoForPlayerAsync(player)
end)

This is also how the ROBLOX Wiki lists how you should attain the information as well which you can find by scrolling to the bottom of this wiki page.

You also are attempting to index the success indicator, as opposed to using the policyInfo itself, which can be rectified like so:

table.find(policyInfo["AllowedExternalLinkReferences"], "Discord")

This is also shown in the wiki page I’ve already linked.