https://gyazo.com/0ea65afecf176abad70672b1269fe8d5
local TablePlayers = {}
while wait(1) do
local regionPart = game.Workspace.Zone
local pos1, pos2 = (regionPart.Position - (regionPart.Size / 2)), (regionPart.Position + (regionPart.Size / 2))
local region = Region3.new(pos1, pos2)
local partsInRegion = workspace:FindPartsInRegion3(region)
for i, Entity in pairs (partsInRegion) do
if (Entity.Parent:FindFirstChildOfClass("Humanoid")) and (Entity.Parent:FindFirstChildOfClass("Humanoid").Health > 0) and Entity.Parent:FindFirstChild("Values") and not Entity.Parent:FindFirstChild("NPC") then
local player = game.Players:GetPlayerFromCharacter(Entity.Parent)
Entity.Parent.Values.AreIn.Value = true
table.insert(TablePlayers,player)
end
end
for _,plr in pairs(game.Players:GetChildren()) do
local character = plr.Character or plr.CharacterAdded:Wait()
if not table.find(TablePlayers,plr) then
character.Values.AreIn.Value = false
end
end
TablePlayers = {}
end
