Hooks
Event hooks let third-party resources add new behavior to the housing system without modifying its core code, ensuring flexibility and maintainability. They are for server-side use only.
RegisterHook
eventName:
string
payload:
table
options?:
table
print?:
boolean
Print to the console when triggering the event.
ownerFilter?:
{ [string]: true }
The event will only trigger for owners defined as keys in a set.
houseFilter?:
{ [number]: true }
The event will only trigger for houses defined as keys in a set.
zoneFilter?:
{ [string]: true }
The event will only trigger for zone defined as keys in a set.
propFilter?:
{ [string]: true }
The event will only trigger for props defined as keys in a set.
userFilter?:
{ [string]: true }
The event will only trigger for identifiers defined as keys in a set.
Return:
hookId:
number
RemoveHooks
id?: number
Hooks events
BuyHouse
This event is triggered when a house is purchased or the setHouseOwner export is used.
By returning false
, you can cancel the action.
payload
source:
number
houseID:
number
count:
number
: Number of player's housespayMethod:
string
price:
number
isSetOwner:
boolean
Example:
AddHolder
This event is executed when an attempt is made to add a keyholder to the house.
By returning false
, you can cancel the action.
payload
source:
number
houseID:
number
identifier:
string
payMethod:
string
name:
string
isSetOwner:
boolean
owner:
string
Example:
RemoveHolder
This event is executed when an attempt is made to remove a keyholder from the house.
By returning false
, you can cancel the action.
payload
source:
number
houseID:
number
owner:
string
identifier:
string
Example:
CreateDoor
This hook is triggered when an attempt is made to create a new door in a house.
By returning false
, you can cancel the action.
payload
source:
number
houseID:
number
name:
string
type:
string
owner:
string
identifier:
string
Example:
DeleteDoor
This hook is triggered when an attempt is made to delete a door from a house.
By returning false
, you can cancel the action.
payload
source:
number
houseID:
number
id:
number
owner:
string
identifier:
string
Example:
OpenDoor
This hook is triggered when an attempt is made to open a door in a house.
By returning false
, you can cancel the action.
payload
source:
number
houseID:
number
id:
number
owner:
string
identifier:
string
Example:
UpdateLight
This hook is triggered when an attempt is made to update a house's lighting.
By returning false
, you can cancel the action.
payload
source:
number
houseID:
number
propId:
string
zone:
string
owner:
string
propModel:
string
identifier:
string
Example:
UpdateBoard
This hook is triggered when an attempt is made to update a board within the house.
By returning false
, you can cancel the action.
payload
source:
number
houseID:
number
propId:
string
url:
string
zone:
string
owner:
string
propModel:
string
identifier:
string
Example:
BuyFurniture
This hook is triggered when an attempt is made to purchase furniture for a house.
By returning false
, you can cancel the action.
payload
source:
number
houseID:
number
propId:
string
zone:
string
owner:
string
propModel:
string
price:
number
identifier:
string
Example:
UpdateFurniture
This hook is triggered when an attempt is made to update existing furniture in a house.
By returning false
, you can cancel the action.
payload
source:
number
houseID:
number
propId:
string
zone:
string
owner:
string
propModel:
string
identifier:
string
Example:
DeleteFurniture
This hook is triggered when an attempt is made to remove furniture from a house.
By returning false
, you can cancel the action.
payload
source:
number
houseID:
number
propId:
string
zone:
string
owner:
string
propModel:
string
price:
number
identifier:
string
Example:
BuyUpgrade
This hook is triggered when an attempt is made to purchase an upgrade for a house.
By returning false
, you can cancel the action.
payload
source:
number
houseID:
number
upgrade:
string
zone:
string
owner:
string
price:
number
identifier:
string
Example:
BuyHouseUpgrade
This hook is triggered when an attempt is made to purchase a house style upgrade.
By returning false
, you can cancel the action.
payload
source:
number
houseID:
number
style:
string
owner:
string
price:
number
identifier:
string
Example:
Last updated