Zone Plus | How I use the "local isWithinZoneBool = Zone:findLocalPlayer()"

I wanted to know how to use this since I need it for a blackout event, but for that I needed to find the players who are already inside the Zone.

Script:

local ZoneArea = game.Workspace.Zones.ZoneZST

local ZoneModule = require(game.ReplicatedStorage.Zone)
local Zone = ZoneModule.new(ZoneArea:GetDescendants())
local Update = Zone.autoUpdate
local Lighting = game:GetService("Lighting")

local Broken = game.Workspace.Construcao.SiteNC.ZST.Construcao.Scriptable.ZSTEnergy.Broken
local Ambience = ZoneArea.Ambience

-- Normal
Zone.localPlayerEntered:Connect(function(Player)
	print(Player.Name.. " entrou em uma nova área")
	Ambience:Play()
end)

Zone.localPlayerExited:Connect(function(Player)
	Ambience:Stop()
	Lighting.Atmosphere.Density = 0.3
	Lighting.EnvironmentDiffuseScale = 1
	Lighting.EnvironmentSpecularScale = 1
end)


--Event
Zone.localPlayerEntered:Connect(function(Player)
	if Broken.Value == true then
		local isWithinZoneBool = Zone:findLocalPlayer()
		if isWithinZoneBool then
			Lighting.Atmosphere.Density = 0.727
			Lighting.EnvironmentDiffuseScale = 0
			Lighting.EnvironmentSpecularScale = 0
		end
	end
end)

Original Post: ZonePlus

1 Like

Still didnt been able to resolve this situation.

1 Like

Someone help me

Literally you don’t even describe what you need, all you state is blackout.

Literally what I said about the name “local isWithinZoneBool”, I wanted to know how to use it.

about the blackout, I would want to use this to know what players are inside that zone and then these players vision become darker.

In better explanation:
The Prisoner presses a Lever then the people who inside that zone will have their vision black meaning they couldn’t see too much.

Then just listen for the value changing and update accordingly.