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