# ShapeClass.client_getAvailableChildConnectionCount

Called to check how many more child (output) connections with the given type [flag](../Game-Script-Environment/Static-Functions/sm.interactable.md#connectiontype) the [Interactable](../Game-Script-Environment/Userdata/Interactable.md) will accept. Return 1 or more to allow a connection of this type.

**Kind:** Callback

**Environments:** Game

## Game

**Callback side:** Client

``` { .lua .api-signature }
ShapeClass:client_getAvailableChildConnectionCount( flags )
```

[Open the full Game reference](../Game-Script-Environment/Classes/ShapeClass.md#client_getavailablechildconnectioncount)

```lua
-- Example of implementation that accepts 10 logic connections and 1 power connection
MyInteractable.maxChildCount = 11
MyInteractable.connectionOutput = sm.interactable.connectionType.logic + sm.interactable.connectionType.power

function MyIteractable.client_getAvailableChildConnectionCount( self, flags )
	if bit.band( flags, sm.interactable.connectionType.logic ) ~= 0 then
		return 10 - self:getParents( sm.interactable.connectionType.logic )
	end
	if bit.band( flags, sm.interactable.connectionType.power ) ~= 0 then
		return 1 - self:getParents( sm.interactable.connectionType.power )
	end
	return 0
end
```

> **Note:**
> [maxChildCount](../Game-Script-Environment/Classes/ShapeClass.md#maxchildcount) must be 1 or more for this callback to be called.

**Parameters:**

| Name | Type | Description |
| --- | --- | --- |
| `self` | table | The class instance. |
| `flags` | integer | Connection type flags. |

**Returns:**

| Type | Description |
| --- | --- |
| integer | The number of available connections. |
