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

Not related to this resource, you inserted a virus.

1 Like

I think this is going to help me with my random weapon spawning system! very cool resource!!

2 Likes

So, this is just a better version of Touched event right?

Not at all? If you read the thread you would see it’s for spatial areas.

1 Like

Oh, that make sense. Thx for the info :>

Check in here to receive new messages.

How could I possibly ignore certain parts when using :getRandomPoint(), which returns a Vector3 value and a table with touching parts. I have multiple zone parts touching each other but I want them to be ignored in the table.

Support for this was introduced in a recent update, so first try updating your module, then if it persists can you provide more details here again.

You can achieve this with item:track(item) and the zone.itemEntered and zone.itemExited events. More details here:

I can look into this thanks for the report!

Have you tried splitting your zones into further zones?

1 Like

What do you mean? I got multiple parts for my zone as it doesn’t have a perfect shape.


This is what it looks like with my zone so far, I’m using this to spawn gems. I simply want to check if something is touching where the random location was, as I don’t want them to spawn in stuff.

Is this base of checking contaction every frame?

im trying to use the :destroy() function on the zone module but it gives me the error: “attempt to index nil with ‘destroy’” on line 870

Does partEntered event count also VehicleSeat? If not, how I can detect it with ZonePlus when a VehicleSeat enter in the zone?

I would like to detect if a VehicleSeat enter in the zone.

Hey, could you hep me out with implementing itemEntered/itemExited? On the docs it says:

zone.itemEntered:Connect(function(item)
    print(("item '%s' entered the zone!"):format(item.Name))
end)

But that code doesn’t run, and I’m guessing items are set up differently but I couldn’t find any info on that. However, using partEntered/partExited works with that same code (changed event names) so I’m a bit confused here.

Thanks!

Hey, this is probably an issue due to my coding, but I have a problem where resetting itemEntered doesn’t work.

This code is in a module on the client and is ran when a part is made

	--Using the Zone+ module to detect when something enters the hitbox
	local hitbox = Zone.new(part)

	--track anythhing that has a humanoidrootpat
	for _,v in pairs(workspace:GetChildren()) do
		if v:FindFirstChild("HumanoidRootPart") then
			hitbox:trackItem(v)	
		end
	end
	
	--detects when the tracked item entered
	hitbox.itemEntered:Connect(function(Target)
		warn("Hit")
		part.Color = Color3.fromRGB(170, 0, 255)
		outline.Color3 = part.Color
		Hit:FireServer(Target) 
	end)

Because when the NPC resets, the new character’s humanoid isn’t the one being tracked.

2 Likes

Please rename the module instance here to MainModule, I want to require by ID so that I don’t have to worry about updating the module! :sob: :sob:

I tried this but it’s really laggy

Requiring via ID is discouraged, it yields your script, you lose intelissense (afaik), and it’s just not a good thing.

Roblox has started to warn devs when a module is required by ID too. I believe this is a way to discourage it a bit as well.

Him doing that would also mean that he wouldn’t be able to be agressive with API changes that break backwards compatibility without creating another model.

It would also mean that he could change something and it would break your game accidentally.

IIRC, TopBar v1 had ID requiring support, but that was dropped in V2, and I can understand why, since it’s a bad practice. I believe he wouldn’t go back and start supporting it.

Well, don’t worry about that. Update if anything breaks, or periodically with all the libraries you use. I’m an update freak but yeah I don’t see it being much of an issue.

Edit: you can also have notifications on GitHub releases on his repo, so you’ll know if anything important gets fixed

1 Like

I have some problems with localPlayerEntered event it doesn’t fire.

local zonemod = require(game.ReplicatedStorage.Zone)
local Zone = zonemod.new(workspace.TESTZONE)

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

1 Like

That’s an amazing module
Its really useful and reliable

1 Like