### Track Item for Zone Events Source: https://github.com/1foreverhd/zoneplus/blob/main/docs/api/zone.md Starts tracking a custom instance (NPC, BasePart) within the zone. This is recommended for detecting custom instances and enables `zone.itemEntered` and `zone.itemExited` events. Items are automatically untracked if destroyed or parented to nil. ```lua zone:trackItem(characterOrBasePart) ``` -------------------------------- ### Get Group Settings Source: https://github.com/1foreverhd/zoneplus/blob/main/docs/api/zone_controller.md Retrieves the current settings for a specified zone group. ```lua local settingsGroup = ZoneController.getGroup(settingsGroupName) ``` -------------------------------- ### Get Parts in Zone Source: https://github.com/1foreverhd/zoneplus/blob/main/docs/api/zone.md Returns an array of all BaseParts that constitute the zone's boundaries. ```lua local partsArray = zone:getParts() ``` -------------------------------- ### Get All Zones Source: https://github.com/1foreverhd/zoneplus/blob/main/docs/api/zone_controller.md Retrieves an array containing all zones managed by the controller. ```lua local zonesArray = ZoneController.getZones() ``` -------------------------------- ### Get Players in Zone Source: https://github.com/1foreverhd/zoneplus/blob/main/docs/index.md Retrieve an array of all players currently within the zone's boundaries using the getPlayers() method. This is useful for infrequent checks. ```lua local playersArray = zone:getPlayers() ``` -------------------------------- ### Get Items in Zone Source: https://github.com/1foreverhd/zoneplus/blob/main/docs/api/zone.md Retrieves an array of all tracked items (BaseParts or Characters) currently within the zone. ```lua local itemsArray = zone:getItems() ``` -------------------------------- ### Access Zone Enter Detection Source: https://github.com/1foreverhd/zoneplus/blob/main/docs/api/zone.md Get the current enter detection mode for a zone. The default is 'Zone.enum.Detection.Automatic'. ```lua local enterDetection = zone.enterDetection --[default: 'Zone.enum.Detection.Automatic'] ``` -------------------------------- ### Get Touching Zones Source: https://github.com/1foreverhd/zoneplus/blob/main/docs/api/zone_controller.md Identifies zones that a player is currently within. Returns an array of zones and a dictionary of parts that are touching those zones. ```lua local touchingZonesArray, touchingPartsDictionary = ZoneController.getTouchingZones(player) ``` -------------------------------- ### Get Random Point in Zone Source: https://github.com/1foreverhd/zoneplus/blob/main/docs/api/zone.md Generates a random point within the zone's region until one falls within its bounds. Returns the point and the group parts it falls within. ```lua local randomVector, touchingZonePartsArray = zone:getRandomPoint() ``` -------------------------------- ### Create a Zone Instance Source: https://github.com/1foreverhd/zoneplus/blob/main/docs/index.md Instantiate a new zone by providing a container instance. The container can be a Model, Folder, BasePart, or a table of BaseParts. ```lua -- Assuming we place ZonePlus in ReplicatedStorage local Zone = require(game:GetService("ReplicatedStorage").Zone) local container = workspace.SafeZoneContainer local zone = Zone.new(container) ``` -------------------------------- ### Execute Callback on Item Enter Source: https://github.com/1foreverhd/zoneplus/blob/main/docs/api/zone.md Tracks an item and executes a callback function when it enters the zone. If the item is already inside, the callback runs immediately. ```lua local item = character:FindFirstChild("HumanoidRootPart") zone:onItemEnter(item, function() print("The item has entered the zone!") end) ``` -------------------------------- ### Connect to localPlayerEntered Event Source: https://github.com/1foreverhd/zoneplus/blob/main/docs/api/zone.md Use this event to trigger actions when the local player enters the zone. This is a client-only event. ```lua zone.localPlayerEntered:Connect(function() print("you entered the zone!") end) ``` -------------------------------- ### Zone Constructors Source: https://github.com/1foreverhd/zoneplus/blob/main/docs/api/zone.md Constructs a new Zone instance. A container is used to define the boundaries of the zone. It can be any non-BasePart instance (such as a Model, Folder, etc.) that contains descendant BaseParts. Alternatively, a container can be a singular BasePart instance, or a table containing an array of BaseParts. ```APIDOC ## new ### Description Constructs a new Zone instance. A container is used to define the boundaries of the zone. It can be any non-BasePart instance (such as a Model, Folder, etc.) that contains descendant BaseParts. Alternatively, a container can be a singular BasePart instance, or a table containing an array of BaseParts. ### Method `Zone.new(container)` ### Parameters - **container** (Instance | table) - Required - The instance or table defining the zone's boundaries. ``` ```APIDOC ## fromRegion ### Description Constructs a zone from the given CFrame and Size. Underneath the hood, it's creating a part (or multiple parts if any size coordinate exceeds 2024), parenting this to a folder (the container), constructing a zone with this container, calling `:relocate()` on that zone (which parents it outside of workspace), then finally returning the zone. ### Method `Zone.fromRegion(cframe, size)` ### Parameters - **cframe** (CFrame) - Required - The CFrame defining the center and orientation of the region. - **size** (Vector3) - Required - The size of the region. ``` -------------------------------- ### Listen for Player Zone Events Source: https://github.com/1foreverhd/zoneplus/blob/main/docs/index.md Connect to playerEntered and playerExited events to detect when players enter or leave a zone. Use .localPlayer events for client-side detection of only the LocalPlayer. ```lua zone.playerEntered:Connect(function(player) print(('%s entered the zone!'):format(player.Name)) end) zone.playerExited:Connect(function(player) print(('%s exited the zone!'):format(player.Name)) end) ``` -------------------------------- ### Zone Methods Source: https://github.com/1foreverhd/zoneplus/blob/main/docs/api/zone.md Provides methods for interacting with and querying the state of a Zone instance. ```APIDOC ## findLocalPlayer ### Description Checks if the local player is within the zone. ### Method `zone:findLocalPlayer()` ### Returns - `boolean` - True if the local player is within the zone, false otherwise. ``` ```APIDOC ## findPlayer ### Description Checks if a specific player is within the zone. ### Method `zone:findPlayer(player)` ### Parameters - **player** (Player) - Required - The player to check. ### Returns - `boolean` - True if the player is within the zone, false otherwise. ``` ```APIDOC ## findPart ### Description Checks if a specific BasePart is within the zone and returns the touching parts within the zone. ### Method `zone:findPart(basePart)` ### Parameters - **basePart** (BasePart) - Required - The BasePart to check. ### Returns - `boolean` - True if the BasePart is within the zone, false otherwise. - `table` - An array of BaseParts within the zone that are touching the provided `basePart`. ``` ```APIDOC ## findItem ### Description Checks if a specific BasePart or Character is within the zone and returns the touching parts within the zone. ### Method `zone:findItem(basePartOrCharacter)` ### Parameters - **basePartOrCharacter** (BasePart | Model) - Required - The BasePart or Character (Model with Humanoid and HumanoidRootPart) to check. ### Returns - `boolean` - True if the item is within the zone, false otherwise. - `table` - An array of BaseParts within the zone that are touching the provided item. ``` ```APIDOC ## findPoint ### Description Checks if a specific position is within the zone and returns the touching parts within the zone. ### Method `zone:findPoint(position)` ### Parameters - **position** (Vector3) - Required - The position to check. ### Returns - `boolean` - True if the position is within the zone, false otherwise. - `table` - An array of BaseParts within the zone that the position falls within. ``` ```APIDOC ## getPlayers ### Description Returns an array of all players currently within the zone. ### Method `zone:getPlayers()` ### Returns - `table` - An array of Player objects currently within the zone. ``` ```APIDOC ## getParts ### Description Returns an array of all BaseParts that define the zone's boundaries. ### Method `zone:getParts()` ### Returns - `table` - An array of BasePart objects that constitute the zone. ``` ```APIDOC ## getItems ### Description Returns an array of all tracked items (BaseParts or Characters) currently within the zone. ### Method `zone:getItems()` ### Returns - `table` - An array of BasePart or Model objects currently being tracked within the zone. ``` ```APIDOC ## getRandomPoint ### Description Generates random points within the zone's region until one falls within its bounds. It then returns this Vector3 and a table array of group parts the point falls within. ### Method `zone:getRandomPoint()` ### Returns - `Vector3` - A random point within the zone's bounds. - `table` - An array of BaseParts within the zone that the random point falls within. ``` ```APIDOC ## trackItem ### Description Starts tracking a specific item (BasePart or Character) within the zone. This is a recommended replacement for part-events/methods for detecting custom instances like NPCs. Once tracked, it can be listened for with the `zone.itemEntered` and `zone.itemExited` events. An item will be automatically untracked if destroyed or has its parent set to `nil`. ### Method `zone:trackItem(characterOrBasePart)` ### Parameters - **characterOrBasePart** (BasePart | Model) - Required - The BasePart or Character (Model with Humanoid and HumanoidRootPart) to track. ``` ```APIDOC ## untrackItem ### Description Stops tracking a specific item (BasePart or Character) within the zone. ### Method `zone:untrackItem(characterOrBasePart)` ### Parameters - **characterOrBasePart** (BasePart | Model) - Required - The BasePart or Character to stop tracking. ``` ```APIDOC ## bindToGroup ### Description Binds the zone to a settings group to enhance the default behavior of a collection of zones. This is particularly useful for zones where you want to guarantee the player/item is not in two zones at once, for example, when working with ambient/music/lighting zones which perfectly border each other. ### Method `zone:bindToGroup(settingsGroupName)` ### Parameters - **settingsGroupName** (string) - Required - The name of the settings group to bind to. ``` ```APIDOC ## unbindFromGroup ### Description Unbinds the zone from its currently associated settings group. ### Method `zone:unbindFromGroup()` ``` ```APIDOC ## setDetection ### Description Sets the precision of checks based upon the [Detection Enum]. Defaults to 'Automatic'. ### Method `zone:setDetection(enumIdOrName)` ### Parameters - **enumIdOrName** (number | string) - Required - The ID or name from the Detection Enum to set the detection precision. ``` ```APIDOC ## relocate ### Description Moves the zone outside of the workspace into a separate WorldModel within ReplicatedStorage or ServerStorage. This action is irreversible - once called it cannot be undone. ### Method `zone:relocate()` ``` ```APIDOC ## onItemEnter ### Description Tracks an item until it has entered the zone, then calls the given function. If the item is already within the zone, the given function is called immediately. ### Method `zone:onItemEnter(characterOrBasePart, callbackFunction)` ### Parameters - **characterOrBasePart** (BasePart | Model) - Required - The BasePart or Character to track. - **callbackFunction** (function) - Required - The function to call when the item enters the zone. ### Example ```lua local item = character:FindFirstChild("HumanoidRootPart") zone:onItemEnter(item, function() print("The item has entered the zone!") end) ``` ``` ```APIDOC ## onItemExit ### Description Tracks an item until it has exited the zone, then calls the given function. If the item is already outside the zone, the given function is called immediately. ### Method `zone:onItemExit(characterOrBasePart, callbackFunction)` ### Parameters - **characterOrBasePart** (BasePart | Model) - Required - The BasePart or Character to track. - **callbackFunction** (function) - Required - The function to call when the item exits the zone. ### Example ```lua local item = character:FindFirstChild("HumanoidRootPart") zone:onItemExit(item, function() print("The item has exited the zone!") end) ``` ``` ```APIDOC ## destroy ### Description Disconnects all connections within the zone, effectively destroying it. ### Method `zone:destroy()` ``` -------------------------------- ### Create Zone from Region Source: https://github.com/1foreverhd/zoneplus/blob/main/docs/api/zone.md Construct a zone using a CFrame and Size. This method handles the creation and relocation of parts to define the zone's boundaries. ```lua local zone = Zone.fromRegion(cframe, size) ``` -------------------------------- ### Connect to localPlayerExited Event Source: https://github.com/1foreverhd/zoneplus/blob/main/docs/api/zone.md Use this event to trigger actions when the local player exits the zone. This is a client-only event. ```lua zone.localPlayerExited:Connect(function() print("you exited the zone!") end) ``` -------------------------------- ### Connect to playerExited Event Source: https://github.com/1foreverhd/zoneplus/blob/main/docs/api/zone.md This event fires when any player exits the zone. It provides the player object as an argument. ```lua zone.playerExited:Connect(function(player) print(("player '%s' exited the zone!"):format(player.Name)) end) ``` -------------------------------- ### localPlayerEntered Source: https://github.com/1foreverhd/zoneplus/blob/main/docs/api/zone.md Fires when the local player enters the zone. This is a client-only event. ```APIDOC ## localPlayerEntered ### Description Fires when the local player enters the zone. This is a client-only event. ### Method Connect ### Parameters - None ### Event Example ```lua zone.localPlayerEntered:Connect(function() print("you entered the zone!") end) ``` ``` -------------------------------- ### Connect to playerEntered Event Source: https://github.com/1foreverhd/zoneplus/blob/main/docs/api/zone.md This event fires when any player enters the zone. It provides the player object as an argument. ```lua zone.playerEntered:Connect(function(player) print(("player '%s' entered the zone!"):format(player.Name)) end) ``` -------------------------------- ### Connect to itemExited Event Source: https://github.com/1foreverhd/zoneplus/blob/main/docs/api/zone.md This event fires when an item exits the zone. It provides the item object as an argument. This is a more optimal alternative to partExited. ```lua zone.itemExited:Connect(function(item) print(("item '%s' exited the zone!"):format(item.Name)) end) ``` -------------------------------- ### localPlayerExited Source: https://github.com/1foreverhd/zoneplus/blob/main/docs/api/zone.md Fires when the local player exits the zone. This is a client-only event. ```APIDOC ## localPlayerExited ### Description Fires when the local player exits the zone. This is a client-only event. ### Method Connect ### Parameters - None ### Event Example ```lua zone.localPlayerExited:Connect(function() print("you exited the zone!") end) ``` ``` -------------------------------- ### getGroup Source: https://github.com/1foreverhd/zoneplus/blob/main/docs/api/zone_controller.md Retrieves the settings for a specified zone group. ```APIDOC ## getGroup ### Description Retrieves the settings for a specified zone group. ### Method ```lua ZoneController.getGroup(settingsGroupName) ``` ### Parameters #### Path Parameters - `settingsGroupName` (string): The name of the group whose settings are to be retrieved. ### Returns - `settingsGroup` (table): A dictionary containing the settings for the specified group. ``` -------------------------------- ### Set Zone Detection Source: https://github.com/1foreverhd/zoneplus/blob/main/docs/index.md Configure how zones detect players and parts using setDetection() or the enterDetection/exitDetection properties. Options include 'Centre', 'WholeBody', and 'Automatic'. ```lua zone:setDetection("WholeBody") ``` ```lua zone.enterDetection = Zone.enum.Detection.WholeBody zone.exitDetection = Zone.enum.Detection.WholeBody ``` -------------------------------- ### itemExited Source: https://github.com/1foreverhd/zoneplus/blob/main/docs/api/zone.md Fires when an item exits the zone. The item object is passed as an argument. This is a more optimal alternative to partExited. ```APIDOC ## itemExited ### Description Fires when an item exits the zone. The item object is passed as an argument. This is a more optimal alternative to partExited. ### Method Connect ### Parameters - **item** (Instance) - The item that exited the zone. ### Event Example ```lua zone.itemExited:Connect(function(item) print(("item '%s' exited the zone!"):format(item.Name)) end) ``` ``` -------------------------------- ### Connect to itemEntered Event Source: https://github.com/1foreverhd/zoneplus/blob/main/docs/api/zone.md This event fires when an item enters the zone. It provides the item object as an argument. This is a more optimal alternative to partEntered. ```lua zone.itemEntered:Connect(function(item) print(("item '%s' entered the zone!"):format(item.Name)) end) ``` -------------------------------- ### playerExited Source: https://github.com/1foreverhd/zoneplus/blob/main/docs/api/zone.md Fires when any player exits the zone. The player object is passed as an argument. ```APIDOC ## playerExited ### Description Fires when any player exits the zone. The player object is passed as an argument. ### Method Connect ### Parameters - **player** (Player) - The player that exited the zone. ### Event Example ```lua zone.playerExited:Connect(function(player) print(("player '%s' exited the zone!"):format(player.Name)) end) ``` ``` -------------------------------- ### Execute Callback on Item Exit Source: https://github.com/1foreverhd/zoneplus/blob/main/docs/api/zone.md Tracks an item and executes a callback function when it exits the zone. If the item is already outside, the callback runs immediately. ```lua local item = character:FindFirstChild("HumanoidRootPart") zone:onItemExit(item, function() print("The item has exited the zone!") end) ``` -------------------------------- ### itemEntered Source: https://github.com/1foreverhd/zoneplus/blob/main/docs/api/zone.md Fires when an item enters the zone. The item object is passed as an argument. This is a more optimal alternative to partEntered. ```APIDOC ## itemEntered ### Description Fires when an item enters the zone. The item object is passed as an argument. This is a more optimal alternative to partEntered. ### Method Connect ### Parameters - **item** (Instance) - The item that entered the zone. ### Event Example ```lua zone.itemEntered:Connect(function(item) print(("item '%s' entered the zone!"):format(item.Name)) end) ``` ``` -------------------------------- ### setGroup Source: https://github.com/1foreverhd/zoneplus/blob/main/docs/api/zone_controller.md Creates or updates a group of zones with specified settings. ```APIDOC ## setGroup ### Description Creates or updates a group of zones with specified settings. This allows for managing multiple zones under a common configuration. ### Method ```lua ZoneController.setGroup(settingsGroupName, properties) ``` ### Parameters #### Path Parameters - `settingsGroupName` (string): The name of the group to create or update. - `properties` (table): A dictionary defining the group's settings. Default properties include `onlyEnterOnceExitedAll` (boolean). ### Properties - `onlyEnterOnceExitedAll` (boolean) - Optional - When set to `true`, it prevents items (players, parts, etc) from entering multiple zones at once within that group. ``` -------------------------------- ### Connect to partExited Event Source: https://github.com/1foreverhd/zoneplus/blob/main/docs/api/zone.md This event fires when a part exits the zone. It provides the part object as an argument. This event is only for unanchored parts and may affect CanCollide. Consider using itemExited for better performance. ```lua zone.partExited:Connect(function(part) print(("part '%s' exited the zone!"):format(part.Name)) end) ``` -------------------------------- ### playerEntered Source: https://github.com/1foreverhd/zoneplus/blob/main/docs/api/zone.md Fires when any player enters the zone. The player object is passed as an argument. ```APIDOC ## playerEntered ### Description Fires when any player enters the zone. The player object is passed as an argument. ### Method Connect ### Parameters - **player** (Player) - The player that entered the zone. ### Event Example ```lua zone.playerEntered:Connect(function(player) print(("player '%s' entered the zone!"):format(player.Name)) end) ``` ``` -------------------------------- ### getZones Source: https://github.com/1foreverhd/zoneplus/blob/main/docs/api/zone_controller.md Retrieves an array of all currently active zones. ```APIDOC ## getZones ### Description Retrieves an array of all currently active zones. ### Method ```lua ZoneController.getZones() ``` ### Returns - `zonesArray` (table): An array containing zone objects. ``` -------------------------------- ### Connect to partEntered Event Source: https://github.com/1foreverhd/zoneplus/blob/main/docs/api/zone.md This event fires when a part enters the zone. It provides the part object as an argument. This event is only for unanchored parts and may affect CanCollide. Consider using itemEntered for better performance. ```lua zone.partEntered:Connect(function(part) print(("part '%s' entered the zone!"):format(part.Name)) end) ``` -------------------------------- ### Set Group Properties Source: https://github.com/1foreverhd/zoneplus/blob/main/docs/api/zone_controller.md Defines or updates settings for a group of zones. The `properties` dictionary can configure group-wide behaviors. ```lua local settingsGroup = ZoneController.setGroup(settingsGroupName, properties) ``` ```lua { onlyEnterOnceExitedAll = true, -- When set to `true`, it prevents items (players, parts, etc) from entering multiple zones at once within that group. } ``` -------------------------------- ### Find Local Player in Zone Source: https://github.com/1foreverhd/zoneplus/blob/main/docs/api/zone.md Checks if the local player is currently within the zone's boundaries. ```lua local isWithinZoneBool = zone:findLocalPlayer() ``` -------------------------------- ### Find Item (BasePart or Character) in Zone Source: https://github.com/1foreverhd/zoneplus/blob/main/docs/api/zone.md Determines if a BasePart or Character model is within the zone and returns the touching parts. ```lua local isWithinZoneBool, touchingZoneParts = zone:findItem(basePartOrCharacter) ``` -------------------------------- ### Bind Zone to Settings Group Source: https://github.com/1foreverhd/zoneplus/blob/main/docs/api/zone.md Associates the zone with a named settings group to enhance default behavior across multiple zones. Useful for ensuring an entity is not in overlapping zones. ```lua zone:bindToGroup(settingsGroupName) ``` -------------------------------- ### Zone Properties Source: https://github.com/1foreverhd/zoneplus/blob/main/docs/api/zone.md This snippet details the properties available for the Zone object, including how to access and modify them. ```APIDOC ## Zone Properties This section describes the properties of the Zone object. ### accuracy **Description**: Controls the accuracy of the zone. Defaults to 'Zone.enum.Accuracy.High'. **Access**: `zone.accuracy` **Modification**: `zone.accuracy = Zone.enum.Accuracy.ITEM_NAME` or use `setAccuracy()`. ### enterDetection **Description**: Sets the detection method for entering the zone. Defaults to 'Zone.enum.Detection.Automatic'. **Access**: `zone.enterDetection` **Modification**: `zone.enterDetection = Zone.enum.Detection.ITEM_NAME` or use `setDetection()`. ### exitDetection **Description**: Sets the detection method for exiting the zone. Defaults to 'Zone.enum.Detection.Automatic'. **Access**: `zone.exitDetection` **Modification**: `zone.exitDetection = Zone.enum.Detection.ITEM_NAME` or use `setDetection()`. ### autoUpdate **Description**: When true, the zone automatically updates when its group parts change size or position, or when a descendant group part is added or removed. Defaults to 'true'. **Access**: `zone.autoUpdate` ### respectUpdateQueue **Description**: When true, prevents the internal `_update()` from being called multiple times within a 0.1 second period. Defaults to 'true'. **Access**: `zone.respectUpdateQueue` ### zoneParts **Description**: A read-only array of baseparts that form the zone, defined in the `container` constructor parameter. **Access**: `zone.zoneParts` ### region **Description**: Read-only property representing the region of the zone. **Access**: `zone.region` ### volume **Description**: Read-only property representing the volume of the zone. **Access**: `zone.volume` ### worldModel **Description**: Read-only property representing the world model of the zone. **Access**: `zone.worldModel` ``` -------------------------------- ### Set Zone Enter Detection Source: https://github.com/1foreverhd/zoneplus/blob/main/docs/api/zone.md Change the enter detection mode for a zone. Use setDetection to modify both types or assign directly for individual settings. ```lua zone.enterDetection = Zone.enum.Detection.ITEM_NAME ``` -------------------------------- ### Zone Respect Update Queue Property Source: https://github.com/1foreverhd/zoneplus/blob/main/docs/api/zone.md Inspect the respectUpdateQueue setting for a zone. When true, it prevents the internal _update() function from being called more than once within a 0.1-second interval. ```lua local bool = zone.respectUpdateQueue --[default: 'true'] ``` -------------------------------- ### Access Zone Exit Detection Source: https://github.com/1foreverhd/zoneplus/blob/main/docs/api/zone.md Retrieve the current exit detection mode for a zone. The default is 'Zone.enum.Detection.Automatic'. ```lua local exitDetection = zone.exitDetection --[default: 'Zone.enum.Detection.Automatic'] ``` -------------------------------- ### Find Part in Zone Source: https://github.com/1foreverhd/zoneplus/blob/main/docs/api/zone.md Checks if a specific BasePart is within the zone and returns the touching parts. ```lua local isWithinZoneBool, touchingZoneParts = zone:findPart(basePart) ``` -------------------------------- ### Set Zone Exit Detection Source: https://github.com/1foreverhd/zoneplus/blob/main/docs/api/zone.md Update the exit detection mode for a zone. The setDetection method can change both types, or you can set them individually. ```lua zone.exitDetection = Zone.enum.Detection.ITEM_NAME ``` -------------------------------- ### getTouchingZones Source: https://github.com/1foreverhd/zoneplus/blob/main/docs/api/zone_controller.md Identifies zones that are currently overlapping with a given player's character or parts. ```APIDOC ## getTouchingZones ### Description Identifies zones that are currently overlapping with a given player's character or parts. ### Method ```lua ZoneController.getTouchingZones(player) ``` ### Parameters #### Path Parameters - `player` (Player): The player object to check for overlapping zones. ### Returns - `touchingZonesArray` (table): An array of zones the player is currently touching. - `touchingPartsDictionary` (table): A dictionary mapping parts to the zones they are touching. ``` -------------------------------- ### Find Specific Player in Zone Source: https://github.com/1foreverhd/zoneplus/blob/main/docs/api/zone.md Determines if a given player is within the zone. ```lua local isWithinZoneBool = zone:findPlayer(player) ``` -------------------------------- ### partEntered Source: https://github.com/1foreverhd/zoneplus/blob/main/docs/api/zone.md Fires when an unanchored part enters the zone. The part object is passed as an argument. Note: This event may interfere with the part's CanCollide property. Consider using itemEntered instead. ```APIDOC ## partEntered ### Description Fires when an unanchored part enters the zone. The part object is passed as an argument. Note: This event may interfere with the part's CanCollide property. Consider using itemEntered instead. ### Method Connect ### Parameters - **part** (BasePart) - The part that entered the zone. ### Event Example ```lua zone.partEntered:Connect(function(part) print(("part '%s' entered the zone!"):format(part.Name)) end) ``` ``` -------------------------------- ### Destroy Zone Source: https://github.com/1foreverhd/zoneplus/blob/main/docs/api/zone.md Disconnects all active connections associated with the zone, effectively cleaning it up. ```lua zone:destroy() ``` -------------------------------- ### partExited Source: https://github.com/1foreverhd/zoneplus/blob/main/docs/api/zone.md Fires when an unanchored part exits the zone. The part object is passed as an argument. Note: This event may interfere with the part's CanCollide property. Consider using itemExited instead. ```APIDOC ## partExited ### Description Fires when an unanchored part exits the zone. The part object is passed as an argument. Note: This event may interfere with the part's CanCollide property. Consider using itemExited instead. ### Method Connect ### Parameters - **part** (BasePart) - The part that exited the zone. ### Event Example ```lua zone.partExited:Connect(function(part) print(("part '%s' exited the zone!"):format(part.Name)) end) ``` ``` -------------------------------- ### Untrack Item from Zone Source: https://github.com/1foreverhd/zoneplus/blob/main/docs/api/zone.md Stops tracking a specific item within the zone. ```lua zone:untrackItem(characterOrBasePart) ``` -------------------------------- ### Relocate Zone Source: https://github.com/1foreverhd/zoneplus/blob/main/docs/api/zone.md Moves the zone outside of the workspace to a separate WorldModel. This action is irreversible. ```lua zone:relocate() ``` -------------------------------- ### Find Point in Zone Source: https://github.com/1foreverhd/zoneplus/blob/main/docs/api/zone.md Checks if a given 3D position is within the zone and returns the touching parts. ```lua local isWithinZoneBool, touchingZoneParts = zone:findPoint(position) ``` -------------------------------- ### Zone Auto Update Property Source: https://github.com/1foreverhd/zoneplus/blob/main/docs/api/zone.md Check the autoUpdate status of a zone. When true, the zone automatically updates its group parts' size or position, or when descendant group parts are added/removed. ```lua local bool = zone.autoUpdate --[default: 'true'] ``` -------------------------------- ### Access Zone Accuracy Source: https://github.com/1foreverhd/zoneplus/blob/main/docs/api/zone.md Retrieve the current accuracy setting of a zone. The default accuracy is 'Zone.enum.Accuracy.High'. ```lua local accuracyEnumId = zone.accuracy --[default: 'Zone.enum.Accuracy.High'] ``` -------------------------------- ### Set Zone Detection Precision Source: https://github.com/1foreverhd/zoneplus/blob/main/docs/api/zone.md Adjusts the precision of zone checks using the [Detection Enum]. Defaults to 'Automatic'. ```lua zone:setDetection(enumIdOrName) ``` -------------------------------- ### Set Zone Accuracy Source: https://github.com/1foreverhd/zoneplus/blob/main/docs/index.md Adjust the frequency of zone checks per second using the setAccuracy() method or the zone.accuracy property. Options include 'High', 'Medium', and 'Low'. ```lua zone:setAccuracy("High") ``` ```lua zone.accuracy = Zone.enum.Accuracy.High ``` -------------------------------- ### Set Zone Accuracy Source: https://github.com/1foreverhd/zoneplus/blob/main/docs/api/zone.md Modify the accuracy setting for a zone. You can use the setAccuracy method or directly assign a value from Zone.enum.Accuracy. ```lua zone.accuracy = Zone.enum.Accuracy.ITEM_NAME ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.