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

provide a test file.

can say it works for earlier module version as I use it in my game(s) and it functions as intended (server&client), not going out of my way to test it without a file

1 Like

I 've found the issue. It was a function I had that removes playerā€™s bundles with HumandDescription.

1 Like

Does anybody know why trackItem doesnā€™t work after resetting? This code is in a server script

local zone_Module = require(game:GetService("ServerScriptService"):WaitForChild("External_Modules"):WaitForChild("Zone"))

local function GetTouchingParts(part, doAttack_F, TypeOfAttack, char, localLightsaber, swingSounds, animator, Damage, Hitbox_Module, player, trueOrFalse)

	local hitBoxZone = zone_Module.new(part)
	for _,v in pairs(workspace.Player_Hitboxes:GetChildren()) do
		hitBoxZone:trackItem(v)	
	end
	hitBoxZone.itemEntered:Connect(function(getHurtBox)
		if getHurtBox:IsDescendantOf(workspace.Player_Hitboxes) then
			if getHurtBox.PlayerOf.Value ~= localPlayer then
				if TypeOfAttack == "Normal" then
					doAttack_F(part)
				else
					doAttack_F(TypeOfAttack, character, localLightsaber, swingSounds, animator, Damage, Hitbox_Module, player, trueOrFalse, part)
				end
			end
		end
	end)
end

I meanā€¦ how you can use zonecontroller.getGroup() properly?

Not sure if anybody will find this useful, however I edited the ā€œLightingZoneā€ script in the StarterPlayerScripts to allow you to use the Module with Atmosphere!

Iā€™m not a scripter, and really only have the most basic of understandings, but if anybody wanted it, here you go:

local Zone = require(game:GetService("ReplicatedStorage").Zone)
local lightingAreas = workspace.LightingAreas
local lighting = game.Lighting.Atmosphere
local tweenService = game:GetService("TweenService")

-- This is our default lighting
local defaultLighting = {
	Density = 0,
	Offset = 0,
	Color = Color3.fromRGB(0,0,0),
	Decay = Color3.fromRGB(0,0,0),
	Glare = 0,
	Haze = 0,
}

--
lightingAreas:WaitForChild("Green", math.huge)

task.wait()
--

for _, container in pairs(lightingAreas:GetChildren()) do
	
	-- Construct the lighting zones and bind them to the same group to ensure that the localPlayer only enters one zone at a time
	local zone = Zone.new(container)
	zone:bindToGroup("EnterOnlyOneZoneAtATime")
	
	-- This is our zone lighting
	local zoneLighting = {
		Density = 0.423,
		Offset = 0.254,
		Color = Color3.fromRGB(126,126,126),
		Decay = Color3.fromRGB(0,33,179),
		Glare = 0.56,
		Haze = 3.1,
	}
	
	-- This is called when the localPlayer enters the zone
	zone.localPlayerEntered:Connect(function()
		tweenService:Create(lighting, TweenInfo.new(0.5), zoneLighting):Play()
	end)
	
	-- This is called when the localPlayer exits the zone
	zone.localPlayerExited:Connect(function()
		tweenService:Create(lighting, TweenInfo.new(0.5), defaultLighting):Play()
	end)
end

Change in use

Iā€™m sure thereā€™s a better way I could have done this, however, simply changing this code is about the extent to my scripting knowledge.

Thank you so much for providing the community this Module ForeverHD!

2 Likes

Hi guys, I wonder if there is any way to make an ā€œEventā€ (For example, changing the atmosphere), to players that ARE already inside a zone? Like, the guys are playing and are in the zone, something random happens with the atmosphere and the people inside this zone are infected with it.

This is posted above:


Merc
LordMercProgrammer

Lord_BradyRocks

Nov '22

zone:findPlayer() is what you need.

1 Reply

Reply

Lord_BradyRocksGame Designer

LordMerc

Nov '22

What is there are 2 zones they are in, meaning there is an overlapping zones and they could be in 2 at the same time? Does zone:findPlayer() return multiple zones?

I cannot rem if I ever got it to work thoā€¦
But if you do, when the event happens, you could loop through the players in the game and see if they are in the zoneā€¦ and or you could be building a table when they enter and exit and then just read the table when the event happens

If you get it working, can you send me a msg with how you did it?

thanks

1 Like

most common foreverhd W thanks again

How I use the local isWithinZoneBool = Zone:findLocalPlayer()?

https://devforum.roblox.com/t/zone-plus-how-i-use-the-local-iswithinzonebool-zonefindlocalplayer/2173939?u=omqfroko

Iā€™m having problems with inconsistent behaviour when players reset or die.
Using .playerEntered in a LocalScript placed in StarterPlayerScripts, it often does not call the function after resetting, but sometimes does, hence being inconsistent.

Show script and show where it is located.

Is there a good way to use this to restrict players from entering the zone conditionally? I realize I can just teleport them, but that will not be natural looking for zones meant to just have a blockade. I donā€™t see a point of entry part of the zoneplus api which would be nice to just bump them back before they entered. Perhaps need to add that feature myself, but curious how others are handling it.

zone around a zone, outer zone on touch looks for condition , if met turn can collide off

1 Like

not bad, but wonā€™t that not work if a player that does not meet the condition enters right after the player that did have it. It would then block the player that was supposed to be able to pass. I think we still need to mess with collision groups.

it would be a local client script that only allows the player

sure but I guess if I am also going to be trying to prevent exploits then it is better to also still push the player out of the zone if they donā€™t meet the condition.

post what your requirements are to enterā€¦ like if they have a tool, or key or something, and I will play around to make itā€¦

your condition is so mysterious ā€¦ like a badgeā€¦ a leaderstats levelā€¦ etcā€¦

thanksā€¦got it working. Appreciate it. I ended up doing like you suggested but to prevent exploits server also checks condition on enter an teleports them out if needed.

Sorry for bumping, have a question: is there a command to get an existing zone? Or will that be added in the future?

Please elaborate on ā€˜commandā€™? This isnā€™t an admin system.