Why doesn't this zoneplus zone detect properly?

Greetings,

This zoneplus zone won’t detect the models properly. Yes the names are spelt correctly in the table but it is not working.

Cheers

local Zone = require(game:GetService("ReplicatedStorage"):WaitForChild("Zone"))

local ScriptParent = script.Parent

if ScriptParent:GetAttribute("Occupied") == nil then
	ScriptParent:SetAttribute("Occupied", false)
end

local BoatNames = {"Speedboat","Jetski","superski","Yacht","yacht but bufffed"}

local TouchingBoats = {}

local zone = Zone.new(ScriptParent)

local function IsBoat(Model)
	if not Model then return false end
	if not Model:IsA("Model") then return false end
	if not Model.PrimaryPart then return false end
	return table.find(BoatNames, Model.Name) ~= nil
end

local function UpdateOccupiedStatus()
	ScriptParent:SetAttribute("Occupied", next(TouchingBoats) ~= nil)
end

zone.playerEntered:Connect(function(Player)
	-- nothing needed for players
end)

zone.itemEntered:Connect(function(item)
	if not item or not item.Parent then return end
	local model = item.Parent
	if IsBoat(model) then
		TouchingBoats[model] = true
		UpdateOccupiedStatus()
	end
end)

zone.itemExited:Connect(function(item)
	if not item or not item.Parent then return end
	local Model = item.Parent
	if TouchingBoats[Model] then
		TouchingBoats[Model] = nil
		UpdateOccupiedStatus()
	end
end)

zone:setAccuracy(0.1)
zone.Active = true
1 Like

Had the same issue and I found out that the module just breaks sometimes, I decided to make my own minimal zone module to replace zonePlus and I recommend that you do this as well or try to find another zone module.

That’s not very helpful as a lot of our features use zoneplus, so I’m not just going to change modules

1 Like

As a quicker reply, I know you said you don’t want to switch to another module, but I’ll put what I use instead because I also had ZonePlus break on me.

It took me a few weeks to switch cause I really didn’t want to change everything, but I’m glad I did. It fixed my issues:
-Reliable zones using pure math & boolean logic


I’ll make a separate reply about trying to help find the actual issue though. I’ve got class, so it’ll have to be in a few hours.

2 Likes

I will consider this, thanks, and I will wait for your solution. If it doesn’t work I’ll consider using that post you linked.

1 Like

no zoneplus does work, you probably just did something wrong or didnt understand how to use the module

ok I’ve tried to make a repro file, and I think in the code that you don’t add anything/append the table TouchingBoats. I think you need to use table.insert() here.



there could be more issues than that, but I’m not sure how the Models move and whatnot

my repro:
reproForBugThing-9-2-2025.rbxl (92.5 KB)

nah its intentional so you dont have to use the model as a key means we get automatic de-duplication

2 Likes

Try using zone.partEntered (and zone.partExited) if you haven’t registered the boat or parts of the boats as items using ZonePlus’ zone:trackItem(PutYourBoatRelatedInstancesHere).

Or, you can register boat-related instances with zone:trackItem and use zone.itemEntered and its exit counterpart:


1 Like

not that this fixed it for me, but I think this only takes a string, not a number (ex: “High”)
https://1foreverhd.github.io/ZonePlus/#accuracy

1 Like

^^ I saw this too–you can also set it to an enum defined in the Zone module:

-- enumName, enumValue, additionalProperty
-- in this case, additionalProperty is the delay between each check
return {
	{"Low", 	1,	1.0},
	{"Medium",	2,	0.5},
	{"High",	3,	0.1},
	{"Precise",	4,	0.0},
}
2 Likes

zoneplus is kinda broken and should not be used. Also, it does things rather ineffciently for most purposes.

this got detection working for me!

I think there’s something wrong with this, though, cause it doesn’t seem to update “Occupied”, or keep it there.

ScriptParent:SetAttribute("Occupied", next(TouchingBoats) ~= nil)

reproForBugThing-9-2-2025.rbxl (92.6 KB)

2 Likes

Thank you, if I can get Occupied working I will mark as solution.

Thank you so much @Reditect! marked as solution :slight_smile:

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.