--p:WaitForChild("detect").Weld.C0 = CFrame.new(Vector3.new(-4.09,0,0))
--p:WaitForChild("detect").Weld.C1 = CFrame.new(Vector3.new(0,0,0))
--i hate roblox welds

local last = os.time()
p.spotter.Touched:Connect(function(hit: Part)
	while #game.Workspace.CurLevel:GetChildren() == 0  do
		task.wait()
	end
	if hit.Parent:FindFirstChild("Humanoid") and os.time() - last >= 0.1 and active and not hit:IsDescendantOf(game.Workspace.CurLevel:GetChildren()[1].PuzzleElements.Guards) then
		last = os.time()
		if hit.Parent:FindFirstChild("Humanoid").Health > 0 then
			hit.Parent:FindFirstChild("Humanoid").Health -= 49
		end
	end
end)

explodeBindable.Event:Connect(function()
	if active then
		active = false
		p.camera.Indicator.Color = Color3.fromRGB(255,0,0)
		p.camera.top.Anchored = false
		p.spotter.Transparency = 1
		camera1st:Cancel()
		camera2nd:Cancel()
		spotter1st:Cancel()
		spotter2nd:Cancel()
	end
end)

while task.wait() and active do
	camera1st:Play()
	spotter1st:Play()
	spotter1st.Completed:Wait()
	task.wait(config.GoalWaitTime.Value)
	camera2nd:Play()
	spotter2nd:Play()
	spotter2nd.Completed:Wait()
	task.wait(config.GoalWaitTime.Value)
end
