Rarx Apartments
Rarx Apartments
Multi-framework apartment and starter housing system for FiveM
- Qbox
- QBCore
- ESX
rarx_apartments
Overview#
RARX Apartments is a starter housing system for FiveM servers. Players can choose an apartment on first spawn, enter instanced interiors with routing buckets, access a personal stash, change outfits, and log out from inside their apartment. The framework is auto-detected at runtime.
Features#
New players choose from configurable apartment locations on first spawn
Each player gets their own interior instance using routing buckets and vertical offset stacking
Built-in stash point inside the apartment with configurable slots and weight
Change clothes inside the apartment with auto-detected appearance system integration
Log out directly from inside the apartment, returning to character selection
Auto-detects ox_target or qb-target for interaction points inside the apartment
Requirements#
- Framework: ESX, QBCore, or QBox (auto-detected)
- ox_lib
- oxmysql
- rarx_lib
Supported Inventories#
The stash system auto-detects your inventory resource:
- ox_inventory
- qs-inventory
- ps-inventory
- codem-inventory
- qb-inventory
Supported Clothing Systems#
The outfit point auto-detects your appearance resource:
- rarx_clothing
- illenium-appearance
- fivem-appearance
- bl_appearance
- qb-clothing
Installation#
Download & Extract
Download the latest version from your Keymaster and extract it to your server's resources folder.
Add to server.cfg
ensure rarx_apartmentsMake sure
ox_lib,oxmysql, andrarx_libare started before this resource.Configure
Edit
config.luato customize apartment locations, stash settings, and interior offsets.Integration with Multicharacter
If using
rarx_multicharacter, enable apartment spawns in its config:Config.Apartments = { enableQBApartmentSpawns = true, showApartmentsToExisting = true, }
Configuration#
General Settings#
Config.Debug = false
Config.Starting = true -- Allow new players to choose an apartment
Config.SpawnOffset = 30 -- Vertical offset between stacked instancesStash Settings#
Config.StashSlots = 30
Config.StashWeight = 100000 -- 100kgInterior Settings#
Configure the interior model and point-of-interest offsets within the apartment:
Config.Interior = {
model = 'furnitured_midapart',
exit = { x = 1.5, y = -10.0, z = 0, h = 358.50 },
poi = {
clothes = { x = -6.028, y = -9.5, z = 1.2, h = 2.263 },
stash = { x = -7.305, y = -3.922, z = 0.5, h = 2.263 },
logout = { x = -0.8, y = 1.0, z = 1.0, h = 2.263 },
}
}Apartment Locations#
Each apartment has an entry point and an interaction zone:
Config.Locations = {
["apartment1"] = {
name = "apartment1",
label = "South Rockford Drive",
coords = {
enter = vector4(-667.02, -1105.24, 14.63, 242.32),
},
zone = {
length = 3.0,
width = 1.0,
height = 2.5,
heading = 245,
}
},
["apartment2"] = {
name = "apartment2",
label = "Morningwood Blvd",
coords = {
enter = vector4(-1288.52, -430.51, 35.15, 124.81),
},
zone = {
length = 3.0,
width = 1.0,
height = 3.0,
heading = 124,
}
},
-- Add more locations as needed
}Default locations included:
| Name | Label |
|---|---|
| apartment1 | South Rockford Drive |
| apartment2 | Morningwood Blvd |
| apartment3 | Integrity Way |
| apartment4 | Tinsel Towers |
| apartment5 | Fantastic Plaza |
Custom Hooks#
The custom/client.lua and custom/server.lua files are not escrowed and can be freely edited to integrate with your server's systems.
Client-Side Hooks#
-- Called when a player enters an apartment
-- Return true to override default behavior
function OnEnterApartment(house, apartmentId)
return false
end
-- Called when a player leaves an apartment
-- Return true to override default behavior
function OnLeaveApartment(house)
return false
end
-- Custom notification override
-- Return true to prevent default notification
function CustomNotify(msg, nType)
return false
end
-- Custom stash open override (client side)
-- Return true to prevent default stash behavior
function CustomOpenStash(apartmentId)
return false
endServer-Side Hooks#
-- Custom stash open override (server side)
-- Return true to prevent default stash behavior
function CustomOpenStash(src, apartmentId)
return false
end
-- Called after a new apartment is created
function OnApartmentCreated(src, apartmentId, apartmentType)
end
-- Called after a player changes their apartment type
function OnApartmentChanged(src, newType)
endBackwards Compatibility#
The config automatically exposes an Apartments global table for compatibility with rarx_multicharacter and other resources that expect the QB-Apartments format:
Apartments = {
Starting = Config.Starting,
SpawnOffset = Config.SpawnOffset,
Locations = Config.Locations,
}Troubleshooting#
Apartment interior not loading
Verify the shell model files (.ytyp) are present in the stream/ folder and that this_is_a_map 'yes' is in the fxmanifest.
Stash not opening
Check that your inventory resource is started. The script auto-detects ox_inventory, qs-inventory, ps-inventory, codem-inventory, or qb-inventory. You can also override stash behavior in custom/server.lua and custom/client.lua.
Players overlapping in apartments
Increase Config.SpawnOffset to add more vertical distance between stacked instances. The default is 30 units.
Outfit point not working
Ensure your clothing/appearance resource is started. Supported: rarx_clothing, illenium-appearance, fivem-appearance, bl_appearance, qb-clothing.
New players not seeing apartment selection
Verify Config.Starting = true in config.lua. If using rarx_multicharacter, also check its apartment integration settings.
Target zones not appearing
The script auto-detects ox_target or qb-target. If neither is started, it falls back to proximity-based text UI prompts.
