# Qb-Housing

<figure><img src="https://547414529-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhgpVpWvvZy9dFGgQw96r%2Fuploads%2F4y3wQEmQLoIAVuwbNSwm%2Fqb.png?alt=media&#x26;token=eeee7cd2-08da-4859-9333-6382643ca95f" alt="" width="140"><figcaption></figcaption></figure>

```
> qb-interior/client/optional.lua

exports('CreateApartament', function(spawn)
	local objects = {}
	local POIOffsets = {}
	POIOffsets.exit = json.decode('{ x = 0.116272, y = 3.522461, z = 1.049965, h = 180.012161}')
	DoScreenFadeOut(500)
	while not IsScreenFadedOut() do Wait(10) end
	RequestModel(`ate_habitacion_deluxe`)
	while not HasModelLoaded(`ate_habitacion_deluxe`) do Wait(1000) end
	local house = CreateObject(`ate_habitacion_deluxe`, spawn.x, spawn.y, spawn.z, false, false, false)
	FreezeEntityPosition(house, true)
	objects[#objects + 1] = house
	TeleportToInterior(spawn.x + POIOffsets.exit.x, spawn.y + POIOffsets.exit.y, spawn.z + POIOffsets.exit.z, POIOffsets.exit.h)
	return { objects, POIOffsets }
end)

exports('CreateApartamentdecorate', function(spawn)
	local objects = {}
	local POIOffsets = {}
	POIOffsets.exit = json.decode('{x = 0.116760, y = 3.361816, z = 1.049973, h = 175.276932}')
	DoScreenFadeOut(500)
	while not IsScreenFadedOut() do Wait(10) end
	RequestModel(`ate_habitacion_deluxe_decorada`)
	while not HasModelLoaded(`ate_habitacion_deluxe_decorada`) do Wait(1000) end
	local house = CreateObject(`ate_habitacion_deluxe_decorada`, spawn.x, spawn.y, spawn.z, false, false, false)
	FreezeEntityPosition(house, true)
	objects[#objects + 1] = house
	TeleportToInterior(spawn.x + POIOffsets.exit.x, spawn.y + POIOffsets.exit.y, spawn.z + POIOffsets.exit.z, POIOffsets.exit.h)
	return { objects, POIOffsets }
end)
```
