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

Awesome - thank you!

User Story: I do a lot of anti exploit work and noclip boundary zones are the main way we use to stop people accessing unauthorized areas. So, obviously, important for it to work like this.

1 Like

Thanks for the info! - Also, if I plan on having multiple points. Would having a module script in each zone part with the capture point settings be better or will having one set of settings inside the main script be good?

It depends on the situation; I typically prefer having configurable values in one central location, however I’ve done both before and it’s ultimately up to preference.

@ForeverHD Wow this is super helpful and good job! Also I never knew you and Oblivious were brothers and that’s cool as well! :upside_down_face:

Keep up the good work and keep on developing, cheers!

1 Like

CanTouch is officially out, can’t wait for the new events

It’s been temporarily disabled again so I’ll wait until its re-release before updating the ZonePlus documentation (hopefully soon!)

Are there any performance issues we should be aware of when moving a zone around?

Really nice and well made. Keep up the good work. :+1:
Also, are there gravity zones included?

The _update method (triggered by a position change) only performs basic mathematical calculations and organisations of tables, and this is in addition to the 9(+1) cap of updates per second (which would otherwise be exceeded if you were dragging a zone part for instance), so you should be absolutely fine.

1 Like

Not in the playground but you could put together a gravity zone super easily with the workspace property and tweenservice:

local MOON_GRAVITY = 1.62 / 9.81
local DEFAULT_GRAVITY = 196.2
local TWEEN_INFO = TweenInfo.new(2)

local Zone = require(game:GetService("ReplicatedStorage").Zone)
local zoneGroup = workspace.Your_Group_Of_Parts
local zone = Zone.new(zoneGroup)

zone.playerEntered:Connect(function(player)
    TweenService:Create(workspace, TWEEN_INFO, {Gravity = MOON_GRAVITY}):Play()
end)

zone.playerExited:Connect(function(player)
    TweenService:Create(workspace, TWEEN_INFO, {Gravity = DEFAULT_GRAVITY}):Play()
end)

workspace.Gravity = DEFAULT_GRAVITY

Whenever I call zone:getPlayers() I get this error,

  17:53:06.943  ReplicatedStorage.Modules.Zone.ZoneController:450: attempt to compare nil and number  -  Server - ZoneController:450
  17:53:06.944  Stack Begin  -  Studio
  17:53:06.945  Script 'ReplicatedStorage.Modules.Zone.ZoneController', Line 450 - function getTouchingZones  -  Studio - ZoneController:450
  17:53:06.946  Script 'ReplicatedStorage.Modules.Zone.ZoneController', Line 327 - function _getZonesAndPlayers  -  Studio - ZoneController:327
  17:53:06.946  Script 'ReplicatedStorage.Modules.Zone', Line 735 - function getPlayers  -  Studio - Zone:735
  17:53:06.947  Script 'ServerScriptService.Script', Line 1016  -  Studio - Script:1016
  17:53:06.947  Script 'ReplicatedStorage.Modules.Zone.Signal', Line 42  -  Studio - Signal:42
  17:53:06.947  Stack End  -  Studio

I’m trying to make entities spawn whenever you’re close to them

This appears to occur when a part is parented to another part which I’d advise against when using ZonePlus due to descendant checks. I’ll resolve the issue in PMs.

Patched an error in v2.1.1 that previously occurred when working with multiple overlapping zones and methods such as getTouchingParts:

Cheers @NotWhutThe for help finding and fixing this.

When I run super quick, it doesn’t work properly. Any suggestions?

Why are you zoning one part in a small size like that…? Just use .Touched instead if you’re just gonna do that.

4 Likes

I’m having an issue with zones not recognizing a player leaves a zone on death or when the character is reset. If they reset their character or die in a zone and immediately respawn in the zone, the zone sees as they never left the zone. I currently have a safe zone implemented where I give a forcefield to players when they enter a safe zone. If they reset their character and respawn immediately in the zone, they won’t get the forcefield again. Is there any way to make sure the playerExited is called when the character is reset or is dead?

I fixed the issue. I had multiple parts parented to one, I’ll just use a folder

Good call, this appears to occur when a player dies within a zone then immediately respawns within that zone. The time difference is so minimal zoneplus then doesn’t detect that player leaving (therefore the new character entering also doesn’t trigger).

This is a logic error on our end so I’ll write up a fix shortly and hopefully have it deployed today or tomorrow.

If this is on the client, try zone:setAccuracy("Precise").

Is this a bug? When I join the game, destroy character model, and replace it with a new one, Zone+ doesn’t work at all. Will there be a fix for this?