SellProperty
lua
This is the same as the sell button in the property menu. The player gets Config.SellPercentage percent of the price the property was bought for. The property then goes to the government, is listed for sale, and all keys are removed.
It fails when:
- The player is offline.
- The player is not the owner. For a society property, the player must be the boss of that society.
- The property is a starter apartment and selling those is turned off.
- A police lockdown blocks selling.
- The property was never bought, or the government already owns it.
- The sellProperty hook cancels it.
Parameters
- playerId:
numberThe player selling the property - propertyId:
numberThe property ID
Return Value
booleanWhether the property was soldstring?The reason, if it failed
Example
lua