AddStarterApartment
lua
The apartment uses the StarterApartment settings. Depending on those settings, the player owns it or rents it for free for the first days. See Starter Apartments.
It fails when:
- Starter apartments are turned off.
- The player already has a starter apartment.
- The building doesn't exist.
The player can be offline.
Parameters
- playerIdentifier:
stringThe player's identifier (citizenid) - buildingId?:
numberThe building to create the apartment in. Defaults to the building in the settings. - playerName?:
stringThe name for the logs when the player is offline. Defaults to'Unknown'.