ZonePlus Script not working

I got a little script (using ZonePlus v3.2.0) and it’s supposed to change a value for a player to true when the player walks into the area. When someone walks in, nothing happens, it doesn’t change the value. It does print that someone enters the area, though. This script also checks if the value is equal to true, and if it is, give player one point.

Here’s my script:

local Zone = require(game:GetService("ReplicatedStorage").Zone)
local container = workspace.OnGroundZone
local zone = Zone.new(container)


zone.playerEntered:Connect(function(plr)
	
	local IsInZone = plr.IsInZone.Value
	IsInZone = true
	
	print(("%s entered the zone!"):format(plr.Name))
	print(IsInZone)
	
end)

zone.playerExited:Connect(function(plr)
	
	local IsInZone = plr.IsInZone.Value
	IsInZone = false
	
	print(("%s exited the zone!"):format(plr.Name))
	print(IsInZone)
	
end)

while wait(1) do
	
	for _, v in pairs(game:GetService("Players"):GetChildren()) do
		
		local IsInZone = v.IsInZone.Value
		
		if IsInZone == true then
			
			v.leaderstats.Points.Value = v.leaderstats.Points.Value + 1
			
		elseif IsInZone == false then
			
			print(IsInZone)
			
		end
		
	end
	
end

What is wrong with my script?

1 Like

I wanna add that I was using the ZonePlus exampels for this, but I’m not really sure why the value won’t change.

What is your script, a local script or a normal script, and where is it located. Any errors in the output?

1 Like

No errors whatsoever. It’s a normal script in SSS. The thing is, it prints that I enter the area, but the value won’t change.

I found a fix to this. I’m just gonna use local isWithinZoneBool = zone:findPlayer(player), instead of changing a value everytime someone enters or leaves the area.