> For the complete documentation index, see [llms.txt](https://documentation.rcore.cz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://documentation.rcore.cz/paid-resources/rcore_housing/api/client.md).

# Client

Client-side exports exposed by `rcore_housing`. Call them from other resources running in the same client.

## 🏠 Properties

<details>

<summary>GetProperty</summary>

Returns the full property data for a given property id.

```lua
---@param propertyId number
---@return table|nil property
local property = exports.rcore_housing:GetProperty(propertyId)
```

Returns `nil` if no property exists with that id.

</details>

<details>

<summary>GetAllProperties</summary>

Returns every property currently known on the client.

```lua
---@return table properties
local properties = exports.rcore_housing:GetAllProperties()
```

</details>

<details>

<summary>TeleportIntoStarterApartment</summary>

Teleports the local player into their [starter apartment](/paid-resources/rcore_housing/features/starter-apartments.md), if they have one. Use this when `Config.StarterApartment.TeleportOnAssign` is disabled, or when a spawn selector integration defers the teleport instead of letting `rcore_housing` do it automatically.

```lua
exports.rcore_housing:TeleportIntoStarterApartment()
```

</details>

## 📍 Player State

<details>

<summary>IsPlayerOnPropertyZone</summary>

Returns whether the player is currently standing in a property yard zone, along with the property id.

```lua
---@return boolean onZone
---@return number|nil propertyId
local onZone, propertyId = exports.rcore_housing:IsPlayerOnPropertyZone()
```

</details>

<details>

<summary>IsPlayerInsideProperty</summary>

Returns the id of the property the player is currently inside, plus its property data.

```lua
---@return number|nil propertyId
---@return table propertyData
local propertyId, propertyData = exports.rcore_housing:IsPlayerInsideProperty()
```

`propertyData` is an empty table (`{}`) when the player is not inside a property.

</details>

<details>

<summary>IsBuilding</summary>

Returns whether a property is a building.

```lua
---@param buildingId number
---@return boolean isBuilding
local isBuilding = exports.rcore_housing:IsBuilding(buildingId)
```

</details>

## 🗝️ Access

<details>

<summary>HasKeys</summary>

Returns whether the player has access to a property - covers ownership, tenant status, shared access, and physical key items.

```lua
---@param propertyId number
---@param doorIndex number|nil nil = master / entry access
---@return boolean hasAccess
local ok = exports.rcore_housing:HasKeys(propertyId, doorIndex)
```

</details>

## 🚓 Raid

<details>

<summary>BreachProperty</summary>

Starts the same breach a police officer triggers from the "Pick lock" / "Break into property" menu option - see [Raid and Lockpick](/paid-resources/rcore_housing/features/raid-and-lockpick.md). The server validates access, the local player plays the breach minigame, and access is granted on success.

```lua
---@param propertyId number|nil nil = closest property within Config.Zones.BreachPropertyDistance
---@param doorId number|nil MLO only; nil = closest door. Ignored on shells (main entry is breached)
---@return boolean dispatched
---@return string message
local dispatched, message = exports.rcore_housing:BreachProperty(propertyId, doorId)
```

`dispatched` is `true` once the breach attempt has been sent to the server - not once the player is inside. Client-side refusals (no property/door nearby, no raid access) notify the player and return `false`. Server-side refusals (fail cooldown, missing lockpick/breach item, owner offline, too few police on duty) notify the player as well but aren't reported back through this export.

</details>

## 🖥️ Menus & UI

<details>

<summary>OpenMarketplace</summary>

Opens the marketplace menu.

```lua
exports.rcore_housing:OpenMarketplace()
```

</details>

<details>

<summary>OpenFurnitureMenu</summary>

Opens the property furniture menu.

```lua
exports.rcore_housing:OpenFurnitureMenu()
```

</details>

<details>

<summary>OpenRealEstate</summary>

Opens the real estate / business menu.

```lua
exports.rcore_housing:OpenRealEstate()
```

</details>

## 🎙️ Events

<details>

<summary>playerEnteredFreecam</summary>

Triggered when a player enters freecam mode.

```lua
---@param serverId number
AddEventHandler("rcore_housing:client:playerEnteredFreecam", function(serverId)
    print("Player " .. serverId .. " entered freecam")
end)
```

**Parameters:**

* `serverId` (number) - The server ID of the player who entered freecam

</details>

<details>

<summary>playerExitFreecam</summary>

Triggered when a player exits freecam mode.

```lua
---@param serverId number
AddEventHandler("rcore_housing:client:playerExitFreecam", function(serverId)
    print("Player " .. serverId .. " exited freecam")
end)
```

**Parameters:**

* `serverId` (number) - The server ID of the player who exited freecam

</details>

{% hint style="info" %}
**vms\_housing Compatibility**

`rcore_housing` emulates vms\_housing freecam events. If you're migrating from vms\_housing, no rewrite needed — hooks work as-is.
{% endhint %}
