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

Ok so i have the zone checking in a localscript like this

rails.localPlayerEntered:Connect(function(player)
	OnRail = true
	FakeRailStart:Play()
	FakeRailLoop:Play()
	Remotes.Sound:FireServer("startrail")
end)
rails.localPlayerExited:Connect(function(player)
	OnRail = false
	FakeRailStart:Stop()
	FakeRailLoop:Stop()
	Remotes.Sound:FireServer("stoprail")
end)

and its working perfectly on the client but sometimes the sounds dont stop on the server? like when a player slightly enters it and leaves like immediately you can still hear the sounds playing.

Is there a cap on how many zones you can have?

This doesn’t sound like a ZonePlus related issue, I’d recommend seeking more help #help-and-feedback (making sure to include your server sided code).

No limit.

Zone.partEntered uses a TouchTransmitter, is there a way to make it so CanTouch is false or make it so parts cant interact with the zone using own touch event while maintaining their touch event for other parts, since i dont want stuff like projectiles interacting with the zone.

image

Nah its all good i fixed it myself, thanks for the response though.

Thanks for the feedback, this is currently a limitation with part checking. I’ve opened up a feature card for this to be completed for the next update:

If there’s anything you’d like added/changed to the proposed API feel free to lemme know!

2 Likes

Sorry i keep asking for so much help, but when someone resets while on the skateboard (skateboard has a localscript in it that uses zoneplus) the whole system just stops working? not even an error in the console or anything.

1 Like

well, the main thing i am looking for right now, is so projectiles with a touchtransmitter does not react with the zone, (usually to fix projectiles reacting is to turn the part that the projectile will touch’s cantouch to false, but doing that with zoneplus causes problems)

If a player dies their tools will be destroyed alongside their character meaning the scripts inside get destroyed too (hence stop working).

Correct me if I’m wrong but doing zone:addToDenylist(yourProjectile) after the proposed API above has been released sounds like it would solve your problem (since the projectile would then be ignored by the zone).

1 Like

I tried moving it to StarterPlayerScripts, StarterCharacterScripts and StarterPack and it always has the same issue.

I think what they are talking about it the projectile itself interacting with the zone.

This is really cool, it opens up potential for new games; even better for people who might not know much Lua, yet.

1 Like

Hello, great module overall! I was wondering how to check in what zone a player is in? I read the API documentation and still didn’t get it. Thanks for the help, I love this resource!

To make this work properlly after the player dies / gear is destroyed do i need to break the connection to the modulescript?

Hey yoshi, you can achieve this two ways:

  1. If you know the zone and want to check a player is within it, do…
local isWithinZoneBool = zone:findPlayer(player)
  1. If you want retrieve an array of all zones the player is within, do…
local ZoneController = require(game.ReplicatedStorage.Zone.ZoneController)
local touchingZonesArray = ZoneController.getTouchingZones(player)

What are you using ZonePlus for within your tool? There may be alternative solutions

im using it in the context of making a more reliable (than touch atleast) system to detect when a skateboard is on a rail or a ledge so it can play the corresponding sound, its in a local script in the board.

rails.localPlayerEntered:Connect(function(player)
	OnRail = true
	FakeRailStart:Play()
	FakeRailLoop:Play()
	Remotes.Sound:FireServer("startrail")
end)
rails.localPlayerExited:Connect(function(player)
	OnRail = false
	FakeRailStart:Stop()
	FakeRailLoop:Stop()
	Remotes.Sound:FireServer("stoprail")
end)

the “FakeRail” stuff is just for the client to hear and the server script deals with the other ones

I love ZonePlus!

Suggestion:

Allow both PascalCase and camelCase so my code doesn’t look weird:

for _, Checkpoints in pairs(Checkpoints:GetChildren()) do
	local CheckpointZone = Zone.new(Checkpoints)
	CheckpointZone.playerEntered:Connect(function(Player) -- This line is odd
		if Checkpoints.Name ~= "EndRace" then
			CheckpointTrue(Checkpoints.Name, Player)
		end
	end)
end

See this response here:

We won’t support PascalCase methods/properties as these don’t conform to the Roblox Lua Formatting Guidelines. You’re welcome to create and maintain your own fork though.

1 Like