> ## Documentation Index
> Fetch the complete documentation index at: https://docsuncv2.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# iscclosure

Tells you whether a function was written in C or in Luau.

```luau theme={null}
iscclosure(func: function): boolean
```

Most commonly used to tell a real Roblox Instance apart from a Luau table pretending to be one - real Instance methods like `Destroy` are always C closures, so a Luau result means the object is a fake.

```luau theme={null}
local function analyzeObject(obj)
    if type(obj.Destroy) == "function" then
        if iscclosure(obj.Destroy) then
            print("this is a raw roblox instance")
            -- interacting directly with the engine
        else
            print("this is a lua proxy/wrapper table")
            -- the game is intercepting this call
        end
    end
end
```

## Parameters

| Parameter | Type       | Description            |
| --------- | ---------- | ---------------------- |
| `func`    | `function` | The function to check. |

## Returns

`true` if `func` is a C closure, `false` if it's a Luau closure.

## Example

<CodeGroup>
  ```luau Example 1 theme={null}
  <<<<<<< HEAD
  local isC = iscclosure(print)
  =======
  -- iscclosure(func: function): boolean
  >>>>>>> 50e30f53759b0538759af25c9b271514aa2c9290
  ```

  ```luau Example 2 theme={null}
  local function analyzeObject(obj)
      if type(obj.Destroy) == "function" then
          if iscclosure(obj.Destroy) then
              print("this is a raw roblox instance")
              -- interacting directly with the engine
          else
              print("this is a lua proxy/wrapper table")
              -- the game is intercepting this call
          end
      end
  end
  ```
</CodeGroup>

<Tip>
  C closures represent built-in engine functions or wrapped native code.
</Tip>
