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

This does not seem to work with characters using skinned mesh parts, is there something extra I’m supposed to do?

Setting zones on client raises this issue on other people.

How’s the new version holding up for you? I’ve noticed the scripts with simple part checks that are only a few lines with this module tend to cause a good amount of memory.

Is there a reason your characters Head is an Accessory instead of a MeshPart?

Currently it assumes if a character contains a HumanoidRootPart and a Head, then that head must be a BasePart, although I can change this behaviour if needed.

@LuaMolecule Can you provide further details? For example, your zone code, snapshots of your server/client memory (search ‘Zone’ into the console), etc.

With coded_kjl we’re narrowed down a small leak which would occur over many hours. This will be patched once I’m back in a few days, although shouldn’t impact you in a noticeable way.

Yea it’s mb, our morphs are set up as so.
image

2 Likes

v3.2.0


We highly recommend all users update to this latest version as it patches a memory leak which occurred from the reapplying of character bodyparts.


On to more exiting notes, this release also introduces two heavily requested methods:
zone:onItemEnter and zone:onItemExit which track a specific item until it has entered/exited the zone, then calls the given callbackFunction.

local item = character:FindFirstChild("HumanoidRootPart")
zone:onItemEnter(item, function()
    print("The item has entered the zone!"))
end)
local item = character:FindFirstChild("HumanoidRootPart")
    zone:onItemExit(item, function()
    print("The item has exited the zone!"))
end)

This is useful for scenarios where you may only want to listen for an item entering/exiting a zone after a certain trigger, instead of constantly.

@coded_jkl Thanks for your help with this, it should be resolved now. Feel free to message again if any usual results pop up.

@imdednowgoaway This is now organised

@LordMerc Non-basepart Heads (such as accessory heads) are now supported :+1:

7 Likes

Just a random question here, what do you think is the best way to make sub zones, such as a boss areas that exist within one main zone? I was able to do it but I’m doubting its performance

Assuming the zones contain the same type of part (e.g. block, sphere, etc), 10000 zones are going to be almost identical in performance to 1 zone since all zones act as a collective (and since checks are typically performed on players/characters/items, not the zones themselves).

1 Like

Sorry if I asked a stupid question but does that mean if I use ZonePlus in my game, do I have to credit and link this thread in my game description?

Sorry if this has been asked before, but I was just wondering if zone.playerExited also activates if a player is inside the zone and then leaves the game. I am wanting to make a queue to enter a game, and I need to be able to detect if a player has left the zone via leaving the game :slight_smile:

Overall, SUPER helpful module and I can’t believe I haven’t been using this prior, seriously, kudos man to your entire team of developers that created this!

It does
image

1 Like

Awesome! Thanks for checking that for me!

1 Like

Is it possible for the ambient sounds to play when you’re sitting? I tried making it, but it broke. I’m trying to make a car radio similar to Mafia 1.

Is it possible to add something like an ignore list or a whitelist soon? It would help very much!

How would I check if the local player character is in a zone in general?

Zone.localPlayerEntered:Connect(function()
      print("Welcome")
end)

Does it support overlapping zones? For example one big zone and a lot of mini zones inside it.

Yes it does, seek here: ZonePlus v3.2.0 | Construct dynamic zones and effectively determine players and parts within their boundaries - #240 by ForeverHD

1 Like

Is there a way to detect if a character spawns inside of a zone, becuase onItemEnter returns:
ReplicatedStorage.Modules.Zone:814: attempt to index nil with Instance - Server - Zone:814
my serverside script in SSS:

repeat wait() until player.Character:FindFirstChild("HumanoidRootPart")
local RootPart = player.Character:FindFirstChild("HumanoidRootPart")
ZP:onItemEnter(RootPart, function()
	print("The item has entered the zone!")
end)

thanks

Depending on if the player is currently in the zone when they die + respawn, playerEntered won’t fire. If they spawn in a different zone, playerEntered should fire accordingly.

1 Like