Zone plus damage zone

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? zone that damages u

  2. What is the issue? the game just crashes when touching the zone

  3. What solutions have you tried so far? yes

After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!

local ReplicatedStorage = game.ReplicatedStorage
local Zone = require(ReplicatedStorage.Zone)
local ZoneController = require(ReplicatedStorage.Zone.ZoneController)

local zone = Zone.fromRegion(
	CFrame.new(),
	Vector3.new(18.037, 53.576, 17.374)
)

-- containers

local simpleContainer = workspace["blizzard damage"]["2"]
local ancestorContainer = workspace["blizzard damage"]
local testsafezone = Zone.new(simpleContainer)

local damage = false

testsafezone.playerEntered:Connect(function(player)
	damage = true
	while task.wait(3) and damage == true do
		player.Character.Humanoid:TakeDamage(10)
		damage = false
		task.wait(3)
		damage = true
	end
end)

testsafezone.playerExited:Connect(function(player)
	damage = false
end)