Skip to main content
Ranch

Events & Exports

Manage ranch properties programmatically, respond to lifecycle and ownership events, and use the included administration commands.

API reference

Export functions

Create, remove or update ranch interiors from another server resource.

6 exports
insertInterior

Creates a new ranch interior at the specified position.

xnumberynumberznumberpricenumbernamestring
Promise
removeInterior

Removes an existing ranch interior.

idnumber
Promise
resetInterior

Resets an interior and clears its ownership-related state.

idnumber
Promise
setInteriorPrice

Updates the purchase price of an existing interior.

idnumberpricenumber
void
setInteriorName

Changes the display name of an existing interior.

idnumbernamestring
void
setInteriorPosition

Updates the position of an existing interior.

idnumberxnumberynumberznumber
void
Event reference

Server events

React to ranch ownership changes and player lifecycle activity from another resource.

3 events
onRanchQuit

Triggered when a player disconnects while inside a ranch instance.

sourcenumberidnumberxnumberynumberznumber
onRanchTrade

Triggered when a player transfers a ranch to another player.

sourcenumberidnumbertargetSourcenumber
onRanchBought

Triggered immediately after a player purchases a ranch.

sourcenumberidnumber

Administration commands​

The included commands provide quick in-game access to common ranch management actions.

/ranch_create_at

Create a ranch at a specified position.

/ranch_create

Create a ranch at your current position.

/ranch_remove

Remove an existing ranch.

/ranch_reset

Reset ranch ownership and related state.

/ranch_set_price

Change the purchase price of a ranch.

/ranch_set_name

Change the display name of a ranch.