ZonePlus v3.2.0 | Construct dynamic zones and effectively determine players and parts within their boundaries

Nice work! This is sooo useful, I will use it alot! This must’ve taken a lot of effort and time, well done! Keep up the good work.

I think you would need to create a part with the same size and position and make that part anchored and visible.

Could someone tell me what serious cause of these errors?

(upload://fnQa6m9o1GLbPR6CUbRJFeuueST.png)

Thank you soo much I was thinking about creating something like this last night in the shower

it says the table index is nil on line 68. So the table reference is missing. as if to say it was never added in the first place

Hello everyone,

I’m stucked with an issue on collision (I guess) with ZonePlus. I can’t clearly debug. Everything seems to be normal from the code logic, but actually something triggers multiple times.

I am creating a zone in server script attached to the part, detecting players enetering and exiting:

local Zone = require(game:GetService("ReplicatedStorage").Zone)
local container = script.Parent
local zone = Zone.new(container)
zone:setAccuracy("Precise")
zone:setDetection("WholeBody")

local ServerScriptService = game:GetService("ServerScriptService")

-- ADD BINDABLE EVENTS FOR SERVER
local Open = ServerScriptService.BindableEvents:WaitForChild("Open")
local Close= ServerScriptService.BindableEvents:WaitForChild("Close")


zone.playerEntered:Connect(function(player)
	print(("%s entered the zone!"):format(player.Name))
	
	Open:Fire(player)
end)

zone.playerExited:Connect(function(player)
	print(("%s exited the zone!"):format(player.Name))
	
	Close:Fire(player)
end)

The script triggers a bindable event that activates another server script that takes care of handling a timer for the specific user. The problem here is that, I don’t understand why, the while loop seems to be triggered multiple times, athough I can’t clearly intercept multiple fires. The print(“Times”) runs more than once per second. The problem happens when you walk close by the bounds of the zone.

local ServerScriptService = game:GetService("ServerScriptService")
local Open = ServerScriptService.BindableEvents:WaitForChild("Open")
local Close = ServerScriptService.BindableEvents:WaitForChild("Close")

local ON = {}

local function processOpenPlayingSessionEvent(player)
	ON[player] = true

	-- SESSION MANAGER
	while ON[player] == true do
		print("Time")
        -- do stuff while ON
		wait(1)
	end
end

local function processClosePlayingSessionEvent(player)
	ON[player] = false
end

Open.Event:Connect(processOpenPlayingSessionEvent)
Close.Event:Connect(processClosePlayingSessionEvent)

Can someone please give it a hint? Would be really appreciated. Stucked here for days…

does regions zones can be custom shapes? like the zones can be cylinders or triangular prisms or others.

Might I start by saying I love this API, it has made region-based scripts so much easier for me. But I need help. How can I get the info of the region that a player enters in? I want a gui to display the name of the part that the player enters, as well as being able to get a string within the part’s children. Here’s the snippet of code from my script.

-- Zone Controller
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Zone = require(ReplicatedStorage.Zone)
local ZoneController = require(ReplicatedStorage.Zone.ZoneController)

-- Containers
local AncestorContainer = workspace.EnvironmentTriggers -- Makes up all the regions within the folder

-- Zone Variables
local ZoneVar = Zone.new(AncestorContainer)
local localPlayer = game.Players.LocalPlayer
local playerGui = localPlayer:WaitForChild("PlayerGui")


ZoneVar.playerEntered:Connect(function(playerWhoEntered) -- Fire script when they enter
	
	playerGui.RegionGUI.Background.Title.Text = ZoneVar:WaitForChild()
	playerGui.RegionGUI.Background.Subtitle.Text = "Adventure Awaits!"

I have a bug where i’m inside a zone and when i run into random parts inside of that zone then sometimes it registers that i’ve left the zone… does anyone have a fix for this?

Just want to report a bug that occurs when applying using

humanoid:ApplyDescription()

The player is no longer detected by a zone after applying a new humanoid description to a player.

Is there anyone else experiencing this?

1 Like

@ForeverHD
Pull Request - Update Enum

It’s only me that I’m getting acess denied to get the model or even the public acess game?

4 Likes

anyone else getting Bad Request while trying to get the model?

1 Like

If a zone is deleted, will it delete the zone related to it, want to use this for a tycoon, but purchases can be removed so gotta be careful not to cause memory leaks.

You will need to grab it off the github.

1 Like

Learn how to script then, not hard to start.

1 Like

I came to this forum for help with the script itself.

I’m pretty sure the zones are connected to the part you set them to. I tested it myself, and it stopped printing “player entered” when the zone part was deleted.

but are the zones and their events properly garbage collected

Regarding if they will free up memory or not, I believe it does but you’ll have to check with the documentation and API. Considering its made by ForeverHD, i’d assume he has accounted for that.